Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Individual::evaluate_with does not take a mutable function. #177

Closed
luleyleo opened this issue Jun 23, 2023 · 1 comment
Closed

Individual::evaluate_with does not take a mutable function. #177

luleyleo opened this issue Jun 23, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@luleyleo
Copy link
Collaborator

pub fn evaluate_with<F>(&mut self, objective_fn: F)
where
F: Fn(&P::Encoding) -> P::Objective,
{
self.objective = Some(objective_fn(&self.solution));
}

This function should take an FnMut. Otherwise, you can't use it to evaluate problems where the evaluation function mutates the evaluator.

@luleyleo luleyleo added the bug Something isn't working label Jun 23, 2023
@Saethox Saethox self-assigned this Jun 25, 2023
@Saethox
Copy link
Collaborator

Saethox commented Jul 6, 2023

Resolved with #178.

@Saethox Saethox closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants