-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make heuristics usable as components #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice improvement. Some nits left, then we can merge this.
pub fn into_builder(self) -> ConfigurationBuilder<P> { | ||
ConfigurationBuilder::new().do_(self.0) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this useful? I can't really come up with a good use case because you could only append to the end, but not within the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this method might only be used in rather obscure cases, but I figured that an elegant way to append to existing configurations could not hurt.
/// Size of the initial population. | ||
pub initial_population_size: Option<u32>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These initialization methods implement both Initialization
and Generation
, either pushing a new population with initial_population_size
on the stack, or regenerating an existing population with a certain size. In the latter use case, no initial_population_size
is needed.
Closes #98, Closes #97
Changes
All heuristics in the
heuristics
module now have a generic template function with the same name as the module (e.g.,heuristics::aco::aco
), which is not specific to a certain problem (parametrized overSingleObjectiveProblem
). They accept aheuristics::<heuristic_name>::Parameters
struct with their specific components and parameters, atermination
criterion and aLogger
.The existing heuristics were converted into
real_<heuristic_name>
orpermutation_<heuristic_name>
functions etc., depending on the problem type they solve, and now use their specific template method internally. They each have their own*Parameters
struct.The heuristic templates make it possible to have heuristics nested within other heuristics, e.g., the
real_iterated_local_search
uses thereal_local_search
configuration internally.