uo.algorithm.metaheuristic package
Subpackages
- uo.algorithm.metaheuristic.electro_magnetism_like_metaheuristic package
- uo.algorithm.metaheuristic.genetic_algorithm package
- uo.algorithm.metaheuristic.variable_neighborhood_search package
- Submodules
- uo.algorithm.metaheuristic.variable_neighborhood_search.problem_solution_vns_support module
- uo.algorithm.metaheuristic.variable_neighborhood_search.vns_optimizer module
VnsOptimizerVnsOptimizerConstructionParametersVnsOptimizerConstructionParameters.additional_statistics_controlVnsOptimizerConstructionParameters.finish_controlVnsOptimizerConstructionParameters.k_maxVnsOptimizerConstructionParameters.k_minVnsOptimizerConstructionParameters.output_controlVnsOptimizerConstructionParameters.problemVnsOptimizerConstructionParameters.random_seedVnsOptimizerConstructionParameters.solution_templateVnsOptimizerConstructionParameters.vns_ls_supportVnsOptimizerConstructionParameters.vns_shaking_support
random()
- Module contents
- uo.algorithm.metaheuristic.simulated_annealing package
- Submodules
- uo.algorithm.metaheuristic.simulated_annealing.sa_optimizer module
SaOptimizerSaOptimizerConstructionParametersSaOptimizerConstructionParameters.additional_statistics_controlSaOptimizerConstructionParameters.finish_controlSaOptimizerConstructionParameters.output_controlSaOptimizerConstructionParameters.problemSaOptimizerConstructionParameters.random_seedSaOptimizerConstructionParameters.sa_neighborhoodSaOptimizerConstructionParameters.sa_temperatureSaOptimizerConstructionParameters.solution_template
- uo.algorithm.metaheuristic.simulated_annealing.sa_temperature_support module
- uo.algorithm.metaheuristic.simulated_annealing.sa_temperature_support_exponential_decay module
- Module contents
Submodules
uo.algorithm.metaheuristic.metaheuristic module
The metaheuristic module describes the class Metaheuristic.
- class uo.algorithm.metaheuristic.metaheuristic.Metaheuristic(finish_control: FinishControl, problem: Problem, solution_template: Solution | None, name: str, output_control: OutputControl | None, random_seed: int | None, additional_statistics_control: AdditionalStatisticsControl | None)
Bases:
AlgorithmThis class represent metaheuristic
- property additional_statistics_control: AdditionalStatisticsControl | None
Property getter for the structure that controls keeping of the statistic during metaheuristic execution
- Returns:
structure that controls that controls keeping of the statistic during metaheuristic execution
- Return type:
Optional[AdditionalStatisticsControl]
- abstract copy()
Copy the current object
- Returns:
new instance with the same properties
- Return type:
- determine_fields_val(fields_def: list[str], fields_val: list[str]) list[str]
Determines fields values upon fields definition and old values
- elapsed_seconds() float
Calculate time elapsed during execution of the metaheuristic algorithm
- Returns:
elapsed time (in seconds)
- Return type:
- property finish_control: FinishControl
Property getter for the structure that controls finish criteria for metaheuristic execution
- Returns:
structure that controls finish criteria for metaheuristic execution
- Return type:
FinishControl
- property random_seed: int
Property getter for the random seed used during metaheuristic execution
- Returns:
random seed
- Return type:
- should_finish() bool
Check if execution of the metaheuristic algorithm should finish
- Returns:
Should execution finish
- Return type:
- string_rep(delimiter: str, indentation: int = 0, indentation_symbol: str = '', group_start: str = '{', group_end: str = '}') str
String representation of the Metaheuristic instance
- Parameters:
delimiter (str) – delimiter between fields
indentation (int, optional, default value 0) – level of indentation
indentation_symbol (str, optional, default value '') – indentation symbol
group_start (str, optional, default value '{') – group start string
group_end (str, optional, default value '}') – group end string
- Returns:
string representation of instance that controls output
- Return type:
- uo.algorithm.metaheuristic.metaheuristic.random() x in the interval [0, 1).
The single_solution_metaheuristic module describes the class SingleSolutionMetaheuristic.
- class uo.algorithm.metaheuristic.single_solution_metaheuristic.SingleSolutionMetaheuristic(finish_control: FinishControl, problem: Problem, solution_template: Solution | None, name: str, output_control: OutputControl | None, random_seed: int | None, additional_statistics_control: AdditionalStatisticsControl | None)
Bases:
MetaheuristicThis class represent single solution metaheuristic
- abstract copy()
Copy the current object
- Returns:
new instance with the same properties
- Return type:
- property current_solution: Solution | None
Property getter for the current solution used during single solution metaheuristic execution
- Returns:
instance of the
uo.solution.Solutionclass subtype – current solution of the problem- Return type:
Solution
- string_rep(delimiter: str, indentation: int = 0, indentation_symbol: str = '', group_start: str = '{', group_end: str = '}') str
String representation of the SingleSolutionMetaheuristic instance
- Parameters:
delimiter (str) – delimiter between fields
indentation (int, optional, default value 0) – level of indentation
indentation_symbol (str, optional, default value '') – indentation symbol
group_start (str, optional, default value '{') – group start string
group_end (str, optional, default value '}') – group end string
- Returns:
string representation of instance that controls output
- Return type:
- uo.algorithm.metaheuristic.single_solution_metaheuristic.random() x in the interval [0, 1).
The population_based_metaheuristic module describes the class PopulationBasedMetaheuristic.
- class uo.algorithm.metaheuristic.population_based_metaheuristic.PopulationBasedMetaheuristic(finish_control: FinishControl, problem: Problem, solution_template: Solution | None, name: str, output_control: OutputControl | None, random_seed: int | None, additional_statistics_control: AdditionalStatisticsControl | None)
Bases:
MetaheuristicThis class represent population metaheuristic
- abstract copy()
Copy the current object
- Returns:
new instance with the same properties
- Return type:
- property current_population: list[Solution] | None
Property getter for the population of solutions within population based metaheuristic execution
- string_rep(delimiter: str, indentation: int = 0, indentation_symbol: str = '', group_start: str = '{', group_end: str = '}') str
String representation of the SingleSolutionMetaheuristic instance
- Parameters:
delimiter (str) – delimiter between fields
indentation (int, optional, default value 0) – level of indentation
indentation_symbol (str, optional, default value '') – indentation symbol
group_start (str, optional, default value '{') – group start string
group_end (str, optional, default value '}') – group end string
- Returns:
string representation of instance that controls output
- Return type:
- uo.algorithm.metaheuristic.population_based_metaheuristic.random() x in the interval [0, 1).
- class uo.algorithm.metaheuristic.metaheuristic_void.MetaheuristicVoid(finish_control: FinishControl, problem: Problem, solution_template: Solution | None = None, name: str = 'metaheuristic-void', output_control: OutputControl | None = None, random_seed: int | None = None, additional_statistics_control: AdditionalStatisticsControl | None = None)
Bases:
Metaheuristic- copy()
Copy the current object
- Returns:
new instance with the same properties
- Return type:
Metaheuristic
- init()
- uo.algorithm.metaheuristic.metaheuristic_void.random() x in the interval [0, 1).
- class uo.algorithm.metaheuristic.single_solution_metaheuristic_void.SingleSolutionMetaheuristicVoid(finish_control: ~uo.algorithm.metaheuristic.finish_control.FinishControl, problem: ~uo.problem.problem.Problem =, solution_template: ~uo.solution.solution.Solution | None = { fitness_value=-inf objective_value=-inf is_feasible=False representation()=None evaluation_cache_cs=Nonerepresentation_distance_cache_cs=None}, name: str = 'ss_metaheuristic_void', output_control: ~uo.algorithm.output_control.OutputControl | None = None, random_seed: int | None = None, additional_statistics_control: ~uo.algorithm.metaheuristic.additional_statistics_control.AdditionalStatisticsControl | None = None)
Bases:
SingleSolutionMetaheuristic- copy()
Copy the current object
- Returns:
new instance with the same properties
- Return type:
SingleSolutionMetaheuristic
- init()
- uo.algorithm.metaheuristic.single_solution_metaheuristic_void.random() x in the interval [0, 1).
- class uo.algorithm.metaheuristic.population_based_metaheuristic_void.PopulationBasedMetaheuristicVoid(finish_control: ~uo.algorithm.metaheuristic.finish_control.FinishControl, problem: ~uo.problem.problem.Problem =, solution_template: ~uo.solution.solution.Solution | None = { fitness_value=-inf objective_value=-inf is_feasible=False representation()=None evaluation_cache_cs=Nonerepresentation_distance_cache_cs=None}, name: str = 'pop_metaheuristic_void', output_control: ~uo.algorithm.output_control.OutputControl | None = None, random_seed: int | None = None, additional_statistics_control: ~uo.algorithm.metaheuristic.additional_statistics_control.AdditionalStatisticsControl | None = None)
Bases:
PopulationBasedMetaheuristic- init()
- uo.algorithm.metaheuristic.population_based_metaheuristic_void.random() x in the interval [0, 1).