ROLLO Checkpoint File
Contents
ROLLO Checkpoint File
The checkpoint file is a serialized pickle file and is based on the DEAP checkpointing system.
The checkpoint file holds the ROLLO simulation results and acts as a restart file.
Restarting Simulation
The checkpoint file updates after each generation runs successfully. If the ROLLO simulation fails during a generation, the user can restart the simulation from the previous generation. Therefore, if you’re running a ROLLO simulation with 10 generations and it fails during generation 3, you can restart the ROLLO simulation from generation 2.
This capability can also be used for running one generation at a time. For example, you’re running a large optimization simulation across many nodes on a supercomputer, and don’t want to waste compute time if the simulation fails part way through. You can run one generation at a time, increasing the number of generations defined in the input file with each run.
Results Analysis
To un-pickle the data and analyze the results:
import pickle
checkpoint_file="checkpoint.pkl"
with open(checkpoint_file, "rb") as cp_file:
cp = pickle.load(cp_file)
Once loaded into Python, the checkpoint file is a dict. The following table describes the keys in the checkpoint file:
Checkpoint File Key |
Description |
---|---|
|
a copy of the input file |
|
a dict with copies of the evaluators’ scripts |
|
the final population (list of reactor model individuals) |
|
number of generations (int) |
|
deap.tools.HallOfFame object (see deap documentation) |
|
deap.tools.Logbook object (see deap documentation) |
|
simulation’s random state (used when restarting simulation) |
|
dict, key: input parameter name, value: index, corresponds to each individual’s input parameter index in |
|
dict, key: output parameter name, value: index, corresponds to each individual’s output parameter index in |
|
list of populations, each population list contains a list of reactor models individuals |
|
list of population outputs, each population list contains a list of reactor model individual’s output parameters |
Each reactor model individual is an Ind
class type with attributes and is a simple
list (DEAP Individual class).
The following code snippet demonstrates a reactor model individual’s attributes:
ind1 = cp["all"]["populations"][0][0]
print(ind1)
[7.930883654471881]
print(ind1.__dict__)
{'fitness': deap.creator.obj((-7.930883654471881,)),
'gen': 0,
'num': 0,
'output': (7.930883654471881, 1.4598642651422447)}
Descriptions of the reactor model individual’s attributes:
Attribute |
Description |
---|---|
|
fitness tuple holds the objective values. The sign refers to whether the objective is to maximize or minimize. |
|
generation |
|
reactor model index in generation |
|
tuple of reactor model individual output parameters |
Examples of how to analyze ROLLO results can be found in the Example Notebooks.