pyrimidine.local_search subpackage

pyrimidine.local_search.random_walk module

class pyrimidine.local_search.random_walk.RandomWalk

Bases: FitnessMixin

Random Walk Algo.

mutate(sigma)
params = {'sigma': 1}
transit(k, *args, **kwargs)

pyrimidine.local_search.simulated_annealing module

Simulated Annealing Algorithm

Ref S. Kirkpatrick, C. D. Gelatt, Jr., M. P. Vecchi. Optimization by Simulated Annealing. 1983: 220(4598): 671-679

class pyrimidine.local_search.simulated_annealing.SimulatedAnnealing(*args, **kwargs)

Bases: PhantomIndividual

Class for Simulated Annealing

params

parameters in SA

Type:

dict

alias = {'chromosomes': 'elements', 'n_chromosomes': 'n_elements'}
apply(f, *args, **kwargs)
property elements
isa(cls)
move(T)

Move phantom

Parameters:

temperature (T {number} --)

property n_elements
params = {'ext_c': 0.99, 'initT': 100, 'int_c': 0.99, 'max_iter': 100, 'n_epochs': 200, 'termT': 0.0001}
regester(name, key, force=True)
regester_map(name, key=None, force=True)
transition(*args, **kwargs)

The core method of the object.

This method transitions one state of the object to another state based on certain rules, such as crossing and mutating for individuals in GA, or the moving method in Simulated Annealing.