Skip to content

Commit

Permalink
🎨 improve population threshold implementation
Browse files Browse the repository at this point in the history
...also remove std::cout from debugging
  • Loading branch information
lenarddome committed Aug 16, 2022
1 parent c77f5df commit 7648f47
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pspGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ List pspGlobal(Function model, List control, bool save = false,
ordinal.slice(i) = evaluate;
}

std::cout << "predictions" << ordinal.n_slices << std::endl;
// compare ordinal patterns to stored ones and update list
uvec include = FindUniqueSlices(ordinal);

Expand All @@ -266,7 +265,7 @@ List pspGlobal(Function model, List control, bool save = false,
last_eval);

storage = OrdinalCompare(storage, ordinal.slices(include));
std::cout << "storage: " << storage.n_slices << std::endl;

// update counts of ordinal patterns
counts = CountOrdinal(storage, ordinal, counts);
underpopulated = find( counts < population );
Expand All @@ -278,8 +277,8 @@ List pspGlobal(Function model, List control, bool save = false,
WriteFile(iteration, jumping_distribution, match, path);
}

// check if parameter_filled threshold is reached
if (iteration == max_iteration || all(counts > population)) {
// check if either of the parameter_filled thresholds is reached
if (iteration == max_iteration || underpopulated.n_elem == 0) {
parameter_filled = TRUE;
}
}
Expand Down

0 comments on commit 7648f47

Please sign in to comment.