Metaheuristic
Metaheuristic
- class Metaheuristic(search_space, f_calls, verbose=True)[source]
Bases:
objectMetaheuristic is a core object which defines the structure of a metaheuristic in Zellij. It is an abtract class.
- search_space
Search space object containing decision variables and the loss function.
- Type
Searchspace
- f_calls
Maximum number of calls to search.space_space.loss.
- Type
int
- save
If True save results into a file
- Type
boolean, optional
- verbose
Activate or deactivate the progress bar.
- Type
boolean, default=True
See also
- Loss Function
Parent class for a loss function.
- Search space
Defines what a search space is in Zellij.
- build_bar(total)[source]
build_bar is a method to build a progress bar. It is a purely aesthetic feature to get info on the execution. You can deactivate it, with verbose=False.
- Parameters
total (int) – Length of the progress bar.
- update_main_pb(nb, explor=True, best=False)[source]
Update the main progress bar with a certain number.
- Parameters
nb (int) – Length of the update. e.g. if the progress bar measure the number of iterations, at each iteration nb=1.
explor (bool, default=True) – If True the color associated to the update will be blue. Orange, otherwise.
best (bool default=False) – If True the score of the current solution will be displayed.
- pending_pb(nb)[source]
Update the progress bar with a pending property (white). This update will be replaced when using update_main_pb.
- Parameters
nb (type) – Length of the pending objects.
- close_bar()[source]
Delete the progress bar. (must be executed at the end of run method)
- abstract run()[source]
Abstract method, describes how to run a metaheuristic