|
GeneticAlgorithm
0.5 (beta)
A python framework for rapid GA prototyping
|
This class stores the best individual of the population, if it is better than the last individual found. More...
Inheritance diagram for GeneticAlgorithm.LoggingOperators.BestLogger:
Collaboration diagram for GeneticAlgorithm.LoggingOperators.BestLogger:Public Member Functions | |
| def | __init__ |
| Base periodic logger constructor. | |
| def | logCallback |
| Add a new individual to the log if it is different to the best logged so far. | |
| def | addToLog |
| def | getBest |
| Get the best individual out of the list containing the population and the best individual found so far. | |
| def | finalize |
| This function is called once at the end of the algorithm run. | |
Public Attributes | |
| bestLog | |
| numEvaluations | |
| criterion | |
| maximize | |
| iterationFrequency | |
Static Public Attributes | |
| iterationCallback = logCallback | |
| evaluationCallback = logCallback | |
This class stores the best individual of the population, if it is better than the last individual found.
Definition at line 6 of file LoggingOperators.py.
| def GeneticAlgorithm.LoggingOperators.BestLogger.__init__ | ( | self, | |
| kwargs | |||
| ) |
Base periodic logger constructor.
| iterationCounter | An initial value for the iteration counter |
| evaluationCounter | An initial value for the individual evaluation counter |
| iterationFrequency | This parameter controls how many iterations have to pass between iterationCallback calls |
| evaluationFrequency | This parameter controls how many individuals are evaluated between evaluationCallback calls |
Reimplemented from GeneticAlgorithm.Core.BasePeriodicOperator.
Definition at line 7 of file LoggingOperators.py.
| def GeneticAlgorithm.LoggingOperators.BestLogger.addToLog | ( | self, | |
| best | |||
| ) |
Definition at line 29 of file LoggingOperators.py.
References GeneticAlgorithm.Core.BasePeriodicOperator.evaluationCounter.
Referenced by GeneticAlgorithm.LoggingOperators.BestLogger.logCallback().
Here is the caller graph for this function:| def GeneticAlgorithm.LoggingOperators.BestLogger.finalize | ( | self, | |
| population | |||
| ) |
This function is called once at the end of the algorithm run.
| population | The population object to operate upon |
Reimplemented from GeneticAlgorithm.Core.GeneticOperator.
Reimplemented in GeneticAlgorithm.PlottingOperators.PlotBestLogger.
Definition at line 58 of file LoggingOperators.py.
References GeneticAlgorithm.LoggingOperators.BestLogger.bestLog, and GeneticAlgorithm.LoggingOperators.BestLogger.numEvaluations.
| GeneticAlgorithm::LoggingOperators.BestLogger::getBest | ( | self, | |
| population | |||
| ) |
Get the best individual out of the list containing the population and the best individual found so far.
Definition at line 35 of file LoggingOperators.py.
References GeneticAlgorithm.LoggingOperators.BestLogger.bestLog, GeneticAlgorithm.LoggingOperators.BestLogger.criterion, GeneticAlgorithm.LoggingOperators.BestLogger.maximize, and GeneticAlgorithm.GraphLibrary.BestPathPlotLogger.maximize.
Referenced by GeneticAlgorithm.LoggingOperators.BestLogger.logCallback().
Here is the caller graph for this function:| GeneticAlgorithm::LoggingOperators.BestLogger::logCallback | ( | self, | |
| population | |||
| ) |
Add a new individual to the log if it is different to the best logged so far.
Definition at line 17 of file LoggingOperators.py.
References GeneticAlgorithm.LoggingOperators.BestLogger.addToLog(), and GeneticAlgorithm.LoggingOperators.BestLogger.getBest().
Referenced by GeneticAlgorithm.PlottingOperators.PlotBestLogger.plotCallback().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 7 of file LoggingOperators.py.
Referenced by GeneticAlgorithm.LoggingOperators.BestLogger::finalize(), GeneticAlgorithm.LoggingOperators.BestLogger::getBest(), GeneticAlgorithm.PlottingOperators.PlotBestLogger::plotCallback(), and GeneticAlgorithm.GraphLibrary.BestPathPlotLogger::plotGraphCallback().
Definition at line 7 of file LoggingOperators.py.
Referenced by GeneticAlgorithm.LoggingOperators.BestLogger.getBest(), and GeneticAlgorithm.PlottingOperators.PlotBestLogger.plotCallback().
Reimplemented in GeneticAlgorithm.GraphLibrary.BestPathPlotLogger, and GeneticAlgorithm.PlottingOperators.PlotBestLogger.
Definition at line 25 of file LoggingOperators.py.
Referenced by GeneticAlgorithm.Core.BasePeriodicOperator.iterate().
Reimplemented in GeneticAlgorithm.GraphLibrary.BestPathPlotLogger, and GeneticAlgorithm.PlottingOperators.PlotBestLogger.
Definition at line 24 of file LoggingOperators.py.
Referenced by GeneticAlgorithm.Core.BasePeriodicOperator.iterate().
Reimplemented from GeneticAlgorithm.Core.BasePeriodicOperator.
Definition at line 7 of file LoggingOperators.py.
Reimplemented in GeneticAlgorithm.GraphLibrary.BestPathPlotLogger.
Definition at line 7 of file LoggingOperators.py.
Referenced by GeneticAlgorithm.LoggingOperators.BestLogger.getBest().
Definition at line 7 of file LoggingOperators.py.
Referenced by GeneticAlgorithm.LoggingOperators.BestLogger.finalize(), GeneticAlgorithm.LoggingOperators.LogGenerations.finalize(), and GeneticAlgorithm.PlottingOperators.PlotBestLogger.plotCallback().