macop.callbacks.Callback

Abstract Checkpoint class

Classes

Callback(_every, _filepath)

Callback abstract class in order to compute some instruction every evaluation

class macop.callbacks.Callback.Callback(_every, _filepath)[source]

Callback abstract class in order to compute some instruction every evaluation

algo

{Algorithm} – main algorithm instance reference

every

{int} – checkpoint frequency used (based on number of evaluations)

filepath

{str} – file path where checkpoints will be saved

abstract load()[source]

Load last backup line of solution and set algorithm state at this backup

abstract run()[source]

Check if necessary to do backup based on every variable

setAlgo(_algo)[source]

Specify the main algorithm instance reference

Parameters

_algo – {Algorithm} – main algorithm instance reference