draft complete. debugging
This commit is contained in:
11
src/main.cpp
11
src/main.cpp
@@ -58,7 +58,7 @@ int main(int argc, char **argv) {
|
||||
Strategy<Array<float>> strat {
|
||||
.num_threads = 1,
|
||||
.batch_size = 1,
|
||||
.num_cells = 100000,
|
||||
.num_cells_per_thread = 100000,
|
||||
.num_generations = num_gens,
|
||||
.test_all = true,
|
||||
.test_chance = 0.0, // doesn't matter
|
||||
@@ -76,13 +76,13 @@ int main(int argc, char **argv) {
|
||||
.fitness=fitness
|
||||
};
|
||||
|
||||
auto res = run(strat);
|
||||
auto best_cell = run(strat);
|
||||
|
||||
float sum = 0;
|
||||
float product = 1;
|
||||
printf("Winning cell: ");
|
||||
for (int i = 0; i < res.best_cell.back().len; i++) {
|
||||
float val = res.best_cell.back()[i];
|
||||
for (int i = 0; i < best_cell.len; i++) {
|
||||
float val = best_cell[i];
|
||||
sum += val;
|
||||
product *= val;
|
||||
printf("%f ", val);
|
||||
@@ -90,7 +90,4 @@ int main(int argc, char **argv) {
|
||||
printf("\n");
|
||||
printf("Final Sum: %f\n", sum);
|
||||
printf("Final Product: %f\n", product);
|
||||
printf("Setup Time (s): %f\n", sync::to_s(res.setup_time));
|
||||
printf("Run Time (s): %f\n", sync::to_s(res.run_time));
|
||||
printf("Average Gen Time (s): %f\n", sync::to_s(res.run_time)/num_gens);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user