From bd0d54a5d5ca084827b94ce3051d2a873268393d Mon Sep 17 00:00:00 2001 From: Charles Ofria Date: Fri, 1 Dec 2023 14:21:39 -0500 Subject: [PATCH] Updated a few files to fix uses of depricated functions. --- examples/math/Range.cpp | 2 +- include/emp/Evolve/NK-const.hpp | 2 +- include/emp/data/Trait.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/math/Range.cpp b/examples/math/Range.cpp index c9ed443b97..72678fdde8 100644 --- a/examples/math/Range.cpp +++ b/examples/math/Range.cpp @@ -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++) { diff --git a/include/emp/Evolve/NK-const.hpp b/include/emp/Evolve/NK-const.hpp index 868116ead8..dd40d50778 100644 --- a/include/emp/Evolve/NK-const.hpp +++ b/include/emp/Evolve/NK-const.hpp @@ -92,7 +92,7 @@ namespace evo { /// Get the fitness of a whole bitstring double GetFitness(const BitSet & genome) const { // Create a double-length genome to easily handle wrap-around. - BitSet genome2( genome.template Export() ); + BitSet genome2( genome.template ExportArray() ); genome2 |= (genome2 << N); double total = 0.0; diff --git a/include/emp/data/Trait.hpp b/include/emp/data/Trait.hpp index 91cb2af4e3..e8b13fb696 100644 --- a/include/emp/data/Trait.hpp +++ b/include/emp/data/Trait.hpp @@ -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); }