$darkmode
DENOPTIM
|
A collection of counters user to count actions taken by the evolutionary algorithm. More...
Public Member Functions | |
Monitor () | |
Creates an unnamed monitor. More... | |
Monitor (String identifier, int genId, String monitorFile, int dumpStep, boolean dumpData, Logger logger) | |
Creates a named monitor that is marked with the given generation number. More... | |
void | changeBy (CounterID cid, int value) |
void | increase (CounterID cid) |
void | increaseBy (CounterID cid, int value) |
void | decrease (CounterID cid) |
void | decreaseBy (CounterID cid, int value) |
void | printHeader (String pathName) throws DENOPTIMException |
void | printSummary () throws DENOPTIMException |
void | printSnapshot (String snapshot) throws DENOPTIMException |
Public Attributes | |
String | name = "noname" |
A name that allows humans to understand what this is a monitor of. More... | |
int | generationId = 0 |
A generation number. More... | |
Private Member Functions | |
String | getMonitorDataHeader () |
Build a string with the names of all counters. More... | |
String | getMonitorDataLine (String prefix) |
Build a string with the value of all counters. More... | |
Private Attributes | |
String | monitorFile = "unset.eamonitor" |
Pathname to a file where to dump data. More... | |
int | dumpStep = 50 |
Number of steps (i.e., attempts to make new candidates) after which we dump data to file, if required. More... | |
boolean | dumpData = false |
Flag requesting to dump the monitor data on file. More... | |
int | dumpsId = 0 |
Counter controlling dumps. More... | |
Logger | logger |
Logger to use. More... | |
final String | NL = System.getProperty("line.separator") |
Static Private Attributes | |
static final long | serialVersionUID = 1L |
Version UID. More... | |
A collection of counters user to count actions taken by the evolutionary algorithm.
Definition at line 36 of file Monitor.java.
denoptim.logging.Monitor.Monitor | ( | ) |
Creates an unnamed monitor.
Definition at line 86 of file Monitor.java.
denoptim.logging.Monitor.Monitor | ( | String | identifier, |
int | genId, | ||
String | monitorFile, | ||
int | dumpStep, | ||
boolean | dumpData, | ||
Logger | logger | ||
) |
Creates a named monitor that is marked with the given generation number.
identifier | the string identifying this monitor. |
genId | the generation number. |
monitorFile | the pathname of the file where to print monitor dumps. |
Definition at line 103 of file Monitor.java.
References denoptim.logging.Monitor.dumpData, denoptim.logging.Monitor.dumpStep, denoptim.logging.Monitor.generationId, denoptim.logging.Monitor.logger, denoptim.logging.Monitor.monitorFile, and denoptim.logging.Monitor.name.
void denoptim.logging.Monitor.changeBy | ( | CounterID | cid, |
int | value | ||
) |
Definition at line 117 of file Monitor.java.
References denoptim.logging.Monitor.dumpData, denoptim.logging.Monitor.dumpsId, denoptim.logging.Monitor.dumpStep, denoptim.logging.Monitor.getMonitorDataLine(), denoptim.logging.Monitor.logger, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.logging.Monitor.NL, and denoptim.logging.Monitor.printSnapshot().
Referenced by denoptim.logging.Monitor.decrease(), denoptim.logging.Monitor.decreaseBy(), denoptim.logging.Monitor.increase(), and denoptim.logging.Monitor.increaseBy().
void denoptim.logging.Monitor.decrease | ( | CounterID | cid | ) |
Definition at line 163 of file Monitor.java.
References denoptim.logging.Monitor.changeBy().
void denoptim.logging.Monitor.decreaseBy | ( | CounterID | cid, |
int | value | ||
) |
Definition at line 170 of file Monitor.java.
References denoptim.logging.Monitor.changeBy().
|
private |
Build a string with the names of all counters.
Definition at line 202 of file Monitor.java.
Referenced by denoptim.logging.Monitor.printHeader().
|
private |
Build a string with the value of all counters.
prefix |
Definition at line 223 of file Monitor.java.
References denoptim.logging.Monitor.generationId, and denoptim.logging.Monitor.name.
Referenced by denoptim.logging.Monitor.changeBy(), and denoptim.logging.Monitor.printSummary().
void denoptim.logging.Monitor.increase | ( | CounterID | cid | ) |
Definition at line 149 of file Monitor.java.
References denoptim.logging.Monitor.changeBy().
Referenced by denoptim.ga.EAUtils.buildGraph(), denoptim.ga.OffspringEvaluationTask.call(), and denoptim.ga.EvolutionaryAlgorithm.evolvePopulation().
void denoptim.logging.Monitor.increaseBy | ( | CounterID | cid, |
int | value | ||
) |
Definition at line 156 of file Monitor.java.
References denoptim.logging.Monitor.changeBy().
void denoptim.logging.Monitor.printHeader | ( | String | pathName | ) | throws DENOPTIMException |
Definition at line 177 of file Monitor.java.
References denoptim.logging.Monitor.getMonitorDataHeader(), and denoptim.io.DenoptimIO.writeData().
Referenced by denoptim.ga.EvolutionaryAlgorithm.run().
void denoptim.logging.Monitor.printSnapshot | ( | String | snapshot | ) | throws DENOPTIMException |
Definition at line 191 of file Monitor.java.
References denoptim.logging.Monitor.monitorFile, and denoptim.io.DenoptimIO.writeData().
Referenced by denoptim.logging.Monitor.changeBy().
void denoptim.logging.Monitor.printSummary | ( | ) | throws DENOPTIMException |
Definition at line 184 of file Monitor.java.
References denoptim.logging.Monitor.getMonitorDataLine(), denoptim.logging.Monitor.monitorFile, and denoptim.io.DenoptimIO.writeData().
Referenced by denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), and denoptim.ga.EvolutionaryAlgorithm.initializePopulation().
|
private |
Flag requesting to dump the monitor data on file.
Definition at line 62 of file Monitor.java.
Referenced by denoptim.logging.Monitor.changeBy(), and denoptim.logging.Monitor.Monitor().
|
private |
Counter controlling dumps.
Definition at line 72 of file Monitor.java.
Referenced by denoptim.logging.Monitor.changeBy().
|
private |
Number of steps (i.e., attempts to make new candidates) after which we dump data to file, if required.
Definition at line 57 of file Monitor.java.
Referenced by denoptim.logging.Monitor.changeBy(), and denoptim.logging.Monitor.Monitor().
int denoptim.logging.Monitor.generationId = 0 |
A generation number.
Definition at line 67 of file Monitor.java.
Referenced by denoptim.logging.Monitor.getMonitorDataLine(), and denoptim.logging.Monitor.Monitor().
|
private |
Logger to use.
Definition at line 77 of file Monitor.java.
Referenced by denoptim.logging.Monitor.changeBy(), and denoptim.logging.Monitor.Monitor().
|
private |
Pathname to a file where to dump data.
Definition at line 51 of file Monitor.java.
Referenced by denoptim.logging.Monitor.Monitor(), denoptim.logging.Monitor.printSnapshot(), and denoptim.logging.Monitor.printSummary().
String denoptim.logging.Monitor.name = "noname" |
A name that allows humans to understand what this is a monitor of.
Definition at line 46 of file Monitor.java.
Referenced by denoptim.logging.Monitor.getMonitorDataLine(), and denoptim.logging.Monitor.Monitor().
|
private |
Definition at line 79 of file Monitor.java.
Referenced by denoptim.logging.Monitor.changeBy().
|
staticprivate |
Version UID.
Definition at line 41 of file Monitor.java.