diff options
author | David Robillard <d@drobilla.net> | 2007-12-06 06:31:12 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-12-06 06:31:12 +0000 |
commit | d0dbdee864a3d38e385906cf05c03fe4c264f5d8 (patch) | |
tree | b37b6d3e0c0fec5774bf8dd4c51dfbba80291613 /src | |
parent | e19c643153b32983cfeb319356dbbc2f7798c4b7 (diff) | |
download | machina-d0dbdee864a3d38e385906cf05c03fe4c264f5d8.tar.gz machina-d0dbdee864a3d38e385906cf05c03fe4c264f5d8.tar.bz2 machina-d0dbdee864a3d38e385906cf05c03fe4c264f5d8.zip |
Trivial fitness measurement.
git-svn-id: http://svn.drobilla.net/lad/machina@955 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/Makefile.am | 17 | ||||
-rw-r--r-- | src/engine/machina/Makefile.am | 1 | ||||
-rw-r--r-- | src/machina.cpp | 14 |
3 files changed, 21 insertions, 11 deletions
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 <iostream> #include <signal.h> -#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<JackDriver> 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> problem(new Problem("./gui/target.mid")); + cout << "Fitness: " << problem->fitness(*engine.machine().get()) << endl; driver->attach("machina"); |