Skip to content

Commit

Permalink
Retaining values not convertable to float64 (anyoptimization#381)
Browse files Browse the repository at this point in the history
It might be useful to assign non float values to individuals, e.g. strings representing categories or identifiers.  
In our case, during the computational expensive evaluation of the population, we can obtain an string identifier with almost no additional costs, which would be in our case better suited for duplicate detection than a distance metric, as multiple individuals with different features might be of identical phenotype, and thus effectively reducing the variance in the population.  
In our local environment, this change did not introduce undesired behavior.
  • Loading branch information
c-feldmann authored Feb 15, 2023
1 parent bbf76dc commit 5af46f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymoo/core/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def evaluate(self,
try:
out[k] = v.astype(np.float64)
except:
pass
out[k] = v

if self.callback is not None:
self.callback(X, out)
Expand Down

0 comments on commit 5af46f3

Please sign in to comment.