$darkmode
DENOPTIM
denoptim.logging.Monitor Class Reference

A collection of counters user to count actions taken by the evolutionary algorithm. More...

Inheritance diagram for denoptim.logging.Monitor:
[legend]
Collaboration diagram for denoptim.logging.Monitor:
[legend]

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...
 

Detailed Description

A collection of counters user to count actions taken by the evolutionary algorithm.

Author
Marco Foscato

Definition at line 36 of file Monitor.java.

Constructor & Destructor Documentation

◆ Monitor() [1/2]

denoptim.logging.Monitor.Monitor ( )

Creates an unnamed monitor.

Definition at line 86 of file Monitor.java.

◆ Monitor() [2/2]

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.

Parameters
identifierthe string identifying this monitor.
genIdthe generation number.
monitorFilethe 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.

Member Function Documentation

◆ changeBy()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decrease()

void denoptim.logging.Monitor.decrease ( CounterID  cid)

Definition at line 163 of file Monitor.java.

References denoptim.logging.Monitor.changeBy().

Here is the call graph for this function:

◆ decreaseBy()

void denoptim.logging.Monitor.decreaseBy ( CounterID  cid,
int  value 
)

Definition at line 170 of file Monitor.java.

References denoptim.logging.Monitor.changeBy().

Here is the call graph for this function:

◆ getMonitorDataHeader()

String denoptim.logging.Monitor.getMonitorDataHeader ( )
private

Build a string with the names of all counters.

Returns

Definition at line 202 of file Monitor.java.

Referenced by denoptim.logging.Monitor.printHeader().

Here is the caller graph for this function:

◆ getMonitorDataLine()

String denoptim.logging.Monitor.getMonitorDataLine ( String  prefix)
private

Build a string with the value of all counters.

Parameters
prefix
Returns

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().

Here is the caller graph for this function:

◆ increase()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ increaseBy()

void denoptim.logging.Monitor.increaseBy ( CounterID  cid,
int  value 
)

Definition at line 156 of file Monitor.java.

References denoptim.logging.Monitor.changeBy().

Here is the call graph for this function:

◆ printHeader()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printSnapshot()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printSummary()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ dumpData

boolean denoptim.logging.Monitor.dumpData = false
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().

◆ dumpsId

int denoptim.logging.Monitor.dumpsId = 0
private

Counter controlling dumps.

Definition at line 72 of file Monitor.java.

Referenced by denoptim.logging.Monitor.changeBy().

◆ dumpStep

int denoptim.logging.Monitor.dumpStep = 50
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().

◆ generationId

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().

◆ logger

Logger denoptim.logging.Monitor.logger
private

Logger to use.

Definition at line 77 of file Monitor.java.

Referenced by denoptim.logging.Monitor.changeBy(), and denoptim.logging.Monitor.Monitor().

◆ monitorFile

String denoptim.logging.Monitor.monitorFile = "unset.eamonitor"
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().

◆ name

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().

◆ NL

final String denoptim.logging.Monitor.NL = System.getProperty("line.separator")
private

Definition at line 79 of file Monitor.java.

Referenced by denoptim.logging.Monitor.changeBy().

◆ serialVersionUID

final long denoptim.logging.Monitor.serialVersionUID = 1L
staticprivate

Version UID.

Definition at line 41 of file Monitor.java.


The documentation for this class was generated from the following file: