From d0dbdee864a3d38e385906cf05c03fe4c264f5d8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 6 Dec 2007 06:31:12 +0000 Subject: Trivial fitness measurement. git-svn-id: http://svn.drobilla.net/lad/machina@955 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/Makefile.am | 17 +++++++++-------- src/engine/machina/Makefile.am | 1 + src/machina.cpp | 14 +++++++++++--- 3 files changed, 21 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 20f02e9..879c00d 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -6,19 +6,20 @@ libmachina_la_CXXFLAGS = @REDLANDMM_CFLAGS@ @RAUL_CFLAGS@ @JACK_CFLAGS@ @GLIBMM_ libmachina_la_LIBADD = @REDLANDMM_LIBS@ @RAUL_LIBS@ @JACK_LIBS@ @GLIBMM_LIBS@ libmachina_la_SOURCES = \ - Node.cpp \ - Edge.cpp \ Action.cpp \ - Machine.cpp \ - Mutation.cpp \ - Loader.cpp \ - MidiAction.cpp \ ActionFactory.cpp \ - SMFDriver.cpp \ + Edge.cpp \ Engine.cpp \ LearnRequest.cpp \ + Loader.cpp \ + Machine.cpp \ + MachineBuilder.cpp \ + MidiAction.cpp \ + Mutation.cpp \ + Node.cpp \ + Problem.cpp \ Recorder.cpp \ - MachineBuilder.cpp + SMFDriver.cpp if WITH_JACK libmachina_la_SOURCES += JackDriver.cpp jack_compat.h diff --git a/src/engine/machina/Makefile.am b/src/engine/machina/Makefile.am index f8666e1..f37974c 100644 --- a/src/engine/machina/Makefile.am +++ b/src/engine/machina/Makefile.am @@ -14,6 +14,7 @@ libmachinainclude_HEADERS = \ MidiAction.hpp \ Mutation.hpp \ Node.hpp \ + Problem.hpp \ Recorder.hpp \ SMFDriver.hpp \ types.hpp diff --git a/src/machina.cpp b/src/machina.cpp index 1a5ecb8..ae75313 100644 --- a/src/machina.cpp +++ b/src/machina.cpp @@ -17,13 +17,14 @@ #include #include -#include "machina/Engine.hpp" -#include "machina/Machine.hpp" -#include "machina/Node.hpp" #include "machina/Action.hpp" #include "machina/Edge.hpp" +#include "machina/Engine.hpp" #include "machina/JackDriver.hpp" +#include "machina/Machine.hpp" #include "machina/MidiAction.hpp" +#include "machina/Node.hpp" +#include "machina/Problem.hpp" using namespace std; using namespace Machina; @@ -52,6 +53,9 @@ main(int argc, char** argv) return -1; } + if ( ! Glib::thread_supported()) + Glib::thread_init(); + SharedPtr driver(new JackDriver()); Redland::World rdf_world; @@ -65,6 +69,10 @@ main(int argc, char** argv) free(uri); */ engine.load_machine(argv[1]); + + // FIXME: temporary hack + SharedPtr problem(new Problem("./gui/target.mid")); + cout << "Fitness: " << problem->fitness(*engine.machine().get()) << endl; driver->attach("machina"); -- cgit v1.2.1