diff options
author | David Robillard <d@drobilla.net> | 2007-12-07 05:26:52 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-12-07 05:26:52 +0000 |
commit | 7e8186df9bdb8bcc0177cb572f39ae96fb046004 (patch) | |
tree | 9e522fb4c98d595f8e97c00aad186b92afaebb22 /src | |
parent | 63afdfa494aa221eeba8965d233119931c177db8 (diff) | |
download | machina-7e8186df9bdb8bcc0177cb572f39ae96fb046004.tar.gz machina-7e8186df9bdb8bcc0177cb572f39ae96fb046004.tar.bz2 machina-7e8186df9bdb8bcc0177cb572f39ae96fb046004.zip |
Fix termination of evolution and resumed Jack execution.
git-svn-id: http://svn.drobilla.net/lad/machina@960 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/Evolver.cpp | 6 | ||||
-rw-r--r-- | src/engine/Problem.cpp | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/engine/Evolver.cpp b/src/engine/Evolver.cpp index 73ff12f..e509d97 100644 --- a/src/engine/Evolver.cpp +++ b/src/engine/Evolver.cpp @@ -72,9 +72,9 @@ Evolver::_run() { float old_best = _ga->best_fitness(); - while (true) { + while (!_exit_flag) { + cout << "{"; _ga->iteration(); - //cout << "I" << endl; float new_best = _ga->best_fitness(); if (new_best > old_best) { @@ -82,6 +82,8 @@ Evolver::_run() old_best = new_best; cout << "NEW BEST: " << new_best << endl; } + + cout << "}" << endl; } } diff --git a/src/engine/Problem.cpp b/src/engine/Problem.cpp index 6c6fdd3..1d11870 100644 --- a/src/engine/Problem.cpp +++ b/src/engine/Problem.cpp @@ -49,7 +49,8 @@ Problem::Problem(const std::string& target_midi, SharedPtr<Machine> seed) } } - cout << "Target length: " << _target._length << endl; + cout << "Target notes: " << _target._n_notes << endl; + cout << "Target duration: " << _target._length << endl; _target.compute(); } @@ -58,7 +59,7 @@ Problem::Problem(const std::string& target_midi, SharedPtr<Machine> seed) float Problem::fitness(const Machine& const_machine) const { - //cout << "f"; + cout << "("; // kluuudge Machine& machine = const_cast<Machine&>(const_machine); @@ -94,6 +95,9 @@ Problem::fitness(const Machine& const_machine) const else f -= _target._note_frequency[i] - eval->_note_frequency[i]; } + + + cout << ")"; return f; } |