rollo.backend

Module Contents

class rollo.backend.BackEnd(checkpoint_file, deap_creator, control_dict, output_dict, input_file, start_time)

The BackEnd class contains methods to save genetic algorithm population results into a pickled checkpoint file and to restart a partially completed genetic algorithm from the checkpoint file.

Parameters
  • checkpoint_file (str) – Name of checkpoint file

  • deap_creator (deap.creator object) – DEAP meta-factory allowing to create classes that will fulfill the needs of the evolutionary algorithms

  • control_dict (OrderedDict) – Ordered dict of control variables as keys and a list of their solver and number of variables as each value

  • output_dict (OrderedDict) – Ordered dict of output variables as keys and solvers as values

  • input_file (str) – input file contents

  • start_time (float) – time the simulation began

results

contains results from simulation

Type

dict

checkpoint_file

Name of checkpoint file

Type

str

creator

DEAP meta-factory allowing to create classes that will fulfill the needs of the evolutionary algorithms

Type

deap.creator object

control_dict

Ordered dict of control variables as keys and a list of their solver and number of variables as each value

Type

OrderedDict

output_dict

Ordered dict of output variables as keys and solvers as values

Type

OrderedDict

input_file

input file contents

Type

str

start_time

time the simulation began

Type

float

initialize_new_backend(self)

Initializes brand new backend object

ind_naming(self)

Returns a dict with control variable name as key and their ordered position in Ind as value

Returns

control variable name as key and ordered position in Ind as value

Return type

dict

output_naming(self)

Returns a dict with output parameter name as key and their ordered position as value

Returns

output parameter name as key and ordered position as value

Return type

dict

initialize_checkpoint_backend(self)

Initialize backend when checkpoint is used

initialize_stats(self)

Initialize DEAP statistics

update_backend(self, pop, gen, invalid_ind, rndstate)

Updates backend. Called after every generation

Parameters
  • pop (list) – list of deap.creator.Ind for that generation

  • gen (int) – generation number

  • invalid_ind (list) – list of deap.creator.Ind whose fitnesses had to be evaluated

  • rndstate (tuple) – current state of the random number generator