Skip to content

Commit

Permalink
Updated a few files to fix uses of depricated functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mercere99 committed Dec 1, 2023
1 parent 25acd17 commit bd0d54a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/math/Range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main()
std::cout << "Upper = " << range.GetUpper() << std::endl;

for (int i = 10; i < 40; i += 5) {
std::cout << "Value " << i << " valid = " << range.Valid(i) << std::endl;
std::cout << "Value " << i << " valid = " << range.Has(i) << std::endl;
}

for (size_t s = 4; s <= 8; s++) {
Expand Down
2 changes: 1 addition & 1 deletion include/emp/Evolve/NK-const.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace evo {
/// Get the fitness of a whole bitstring
double GetFitness(const BitSet<N> & genome) const {
// Create a double-length genome to easily handle wrap-around.
BitSet<N*2> genome2( genome.template Export<N*2>() );
BitSet<N*2> genome2( genome.template ExportArray<N*2>() );
genome2 |= (genome2 << N);

double total = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion include/emp/data/Trait.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace emp {
void SetMax(value_t max) { range.SetUpper(max); }

value_t Eval(target_t & target) const { return fun(target); }
value_t EvalLimit(target_t & target) const { return range.LimitValue(fun(target)); }
value_t EvalLimit(target_t & target) const { return range.Clamp(fun(target)); }
std::string EvalString(target_t & target) const { return std::to_string(EvalLimit(target)); }
double EvalValue(target_t & target) const { return (double) EvalLimit(target); }

Expand Down

0 comments on commit bd0d54a

Please sign in to comment.