diff options
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; } |