Miind
Public Member Functions | Private Attributes | List of all members
MPILib::SimulationRunParameter Class Reference

#include <libs/MPILib/include/SimulationRunParameter.hpp>

Collaboration diagram for MPILib::SimulationRunParameter:
Collaboration graph

Public Member Functions

 SimulationRunParameter (const report::handler::AbstractReportHandler &handler, Number max_iter, Time t_begin, Time t_end, Time t_report, Time t_step, const std::string &name_log="", Time t_state_report=0, bool bOnCanvas=false)
 
 SimulationRunParameter (const SimulationRunParameter &parameter)
 
const report::handler::AbstractReportHandlergetHandler () const
 
std::string getLogName () const
 
Number getMaximumNumberIterations () const
 
Time getTBegin () const
 
Time getTEnd () const
 
Time getTReport () const
 
Time getTState () const
 
Time getTStep () const
 
SimulationRunParameteroperator= (const SimulationRunParameter &parameter)
 

Private Attributes

bool _bOnCanvas
 
std::string _logFileName
 
Number _maxIter
 
const report::handler::AbstractReportHandler_pHandler
 
Time _tBegin
 
Time _tEnd
 
Time _tReport
 
Time _tStateReport
 
Time _tStep
 

Detailed Description

Parameter determining how a simulation is run. Specifiying begin and end time, log file names, etc.

This Parameter requires a handler, which determines how the simulation results are stored to disk. Common choices are AsciiReportHandler or RootReportHandler (see their respective documentation). Begin and end times of the simulation must be specified. Report time indicates at which time the simulation results should be written by the Handler. Clearly one wants to set a report time that on the one hand represents the simulation accurately, but on the other hand does not burden the simulation by writing out massive amounts of data, thereby impeding simulation efficiency. An update time allows to set a report time for an online visualisation module. The objective of online visualization is typically to monitor whether the simulation behaves as expected, whilst running. Since visualization can make a heavy demand on processing time on a single core machine (e.g. during development), it makes sense to update much less than to report. The maximum number of iterations is there to prevent endless loops or to specify a maximum number of iterations that is reasonable. It allows for automatically breaking off simulations that have gone on expectedly long. The string specifies the path of the log file, where the status of the simulation is reported during running. In some simulations, typically involving population density techniques, the nodes have an activity as well as a state. By default only activities are written into the simulation results by the handler, but optionally an Algorithms state can be stored as well. This is specified by the State Report time, which must be set in order for more than just the beginning and the end state to be written out. See the example programs in BasicDemos for applications.

Examples:
population-example.cpp.

Definition at line 48 of file SimulationRunParameter.hpp.

Constructor & Destructor Documentation

MPILib::SimulationRunParameter::SimulationRunParameter ( const report::handler::AbstractReportHandler handler,
Number  max_iter,
Time  t_begin,
Time  t_end,
Time  t_report,
Time  t_step,
const std::string &  name_log = "",
Time  t_state_report = 0,
bool  bOnCanvas = false 
)

The standard constructor

Parameters
handlerReportHandler (where and how is the NodeState information recorded ?)
max_itermaximum number of iterations
t_beginStart time of simulation
t_endEnd time of Simulation
t_reportReport time
t_stepNetwork step time
name_logLog file path name
Attention
without extension If you do not provide a string the log is printed to std::cerr
Parameters
t_state_reportReport State time
bOnCanvasWhether or not a simulation should shown on a Canvas. This only works on code that has been compiled with MPI_ENABLED switched off.

Definition at line 23 of file SimulationRunParameter.cpp.

MPILib::SimulationRunParameter::SimulationRunParameter ( const SimulationRunParameter parameter)

copy constructor

Parameters
parameterAnother SimulationRunParameter

Definition at line 39 of file SimulationRunParameter.cpp.

Member Function Documentation

const report::handler::AbstractReportHandler & MPILib::SimulationRunParameter::getHandler ( ) const

Getter for the Handler

Returns
the handler

Definition at line 99 of file SimulationRunParameter.cpp.

References _pHandler.

Referenced by MPILib::MPINode< Weight, NodeDistribution >::configureSimulationRun().

std::string MPILib::SimulationRunParameter::getLogName ( ) const

Getter for the log name

Returns
the log file name

Definition at line 90 of file SimulationRunParameter.cpp.

References _logFileName, and MPILib::utilities::FileNameGenerator::getFileName().

Referenced by MPILib::MPINetwork< WeightValue, NodeDistribution >::configureSimulation().

Number MPILib::SimulationRunParameter::getMaximumNumberIterations ( ) const

Getter for the maximum number of iterations

Returns
the maximum number of iterations

Definition at line 103 of file SimulationRunParameter.cpp.

References _maxIter.

Referenced by GeomLib::OUAlgorithm::configure(), MPILib::WilsonCowanAlgorithm::configure(), and MPILib::MPINode< Weight, NodeDistribution >::configureSimulationRun().

Time MPILib::SimulationRunParameter::getTBegin ( ) const
Time MPILib::SimulationRunParameter::getTEnd ( ) const
Time MPILib::SimulationRunParameter::getTReport ( ) const

Getter for the report time

Returns
the report time

Definition at line 78 of file SimulationRunParameter.cpp.

References _tReport.

Referenced by GeomLib::GeomAlgorithm< WeightValue >::configure(), and MPILib::MPINetwork< WeightValue, NodeDistribution >::configureSimulation().

Time MPILib::SimulationRunParameter::getTState ( ) const

Getter for the state report

Returns
the state report time

Definition at line 86 of file SimulationRunParameter.cpp.

References _tStateReport.

Referenced by MPILib::MPINetwork< WeightValue, NodeDistribution >::configureSimulation().

Time MPILib::SimulationRunParameter::getTStep ( ) const
SimulationRunParameter & MPILib::SimulationRunParameter::operator= ( const SimulationRunParameter parameter)

copy operator

Parameters
parameterAnother SimulationRunParameter

Definition at line 52 of file SimulationRunParameter.cpp.

References _logFileName, _maxIter, _pHandler, _tBegin, _tEnd, _tReport, _tStateReport, and _tStep.

Member Data Documentation

bool MPILib::SimulationRunParameter::_bOnCanvas
private

Definition at line 144 of file SimulationRunParameter.hpp.

std::string MPILib::SimulationRunParameter::_logFileName
private

Definition at line 140 of file SimulationRunParameter.hpp.

Referenced by getLogName(), and operator=().

Number MPILib::SimulationRunParameter::_maxIter
private

Definition at line 133 of file SimulationRunParameter.hpp.

Referenced by getMaximumNumberIterations(), and operator=().

const report::handler::AbstractReportHandler* MPILib::SimulationRunParameter::_pHandler
private

Definition at line 131 of file SimulationRunParameter.hpp.

Referenced by getHandler(), and operator=().

Time MPILib::SimulationRunParameter::_tBegin
private

Definition at line 135 of file SimulationRunParameter.hpp.

Referenced by getTBegin(), and operator=().

Time MPILib::SimulationRunParameter::_tEnd
private

Definition at line 136 of file SimulationRunParameter.hpp.

Referenced by getTEnd(), and operator=().

Time MPILib::SimulationRunParameter::_tReport
private

Definition at line 137 of file SimulationRunParameter.hpp.

Referenced by getTReport(), and operator=().

Time MPILib::SimulationRunParameter::_tStateReport
private

Definition at line 142 of file SimulationRunParameter.hpp.

Referenced by getTState(), and operator=().

Time MPILib::SimulationRunParameter::_tStep
private

Definition at line 138 of file SimulationRunParameter.hpp.

Referenced by getTStep(), and operator=().


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