Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
MonitoringManager Class Referenceabstract

Manager of the benchmark tests. More...

#include <MonitoringManager.h>

Public Member Functions

void addMonitor (Monitor *monitor)
 add a monitor to the list
virtual bool checkStop ()=0
 Check if simulation is finished.
void deleteMonitor (const unsigned int i)
 delete a monitor and remove it from the list using its index
virtual void doMove ()=0
 Do one step of simulation and save monitors for this step.
virtual void end ()=0
 End manager.
MonitorgetMonitor (const unsigned int i) const
 get a monitor by its index in the list
void incStep ()
 increment step by one
virtual bool init ()=0
 Initialize manager.
bool isLmlPresent ()
 check if a lml is present
bool isPmlPresent ()
 check if a scn is present instead of pmlFileName
 MonitoringManager (const char *mml)
 constructor
unsigned int numberOfMonitor () const
 get the number of monitors stored in the list
void reload (bool delPml=true)
 reload simulation with current parameters
void rewind ()
 Rewind simulation.
void saveMmlIn (const char *fileName)
 save current version of mml in
void saveMonitors ()
 Save save monitors' state for the current time.
void setCurrentTime (double time)
 mutators for simulation parameters
void setDt (double dt)
 change dt and save modification into mmlIn
void setLmlFileName (const char *file)
 change lml file name and save modification into mmlIn
void setPmlFileName (const char *file)
 change pml file name and save modification into mmlIn
void setRefresh (double refresh)
 change refresh and save modification into mmlIn
void simulate ()
 perform simulation loop, make tests and save monitors' data into output file
void storeOldPositions ()
 store old positions before next step
void updateComputingTime ()
 add step computing time to total computing time
void updateCurrentTime ()
 add dt to current time
void writeCsv (const char *fileName)
 Write all saved monitors'state into csv file.
void writeOutput (const char *fileName)
 Write all saved monitors' states into mmlOut file.
virtual ~MonitoringManager ()
 destructor
accessors for simulation parameters
double getDt ()
double getRefresh ()
double getCurrentTime ()
double getCurrentStep ()
double getStepComputingTime ()
double getComputingTime ()
PhysicalModelgetInitPml ()
PhysicalModelgetPml ()
PhysicalModeltakePml ()
 This is nearly the same as getPml(), but it also transfers ownership of the pointer.
LoadsgetLml ()
LoadstakeLml ()
 This is nearly the same as getLml(), but it also transfers ownership of the pointer.
std::string getPmlFileName ()
std::string getLmlFileName ()
std::string getMmlFileName ()
std::string getmmlFileFolder ()
SimulatorgetSimulator ()
void getOldPosition (double pos[3], unsigned int index)
 get atom position for precedent step

Protected Attributes

double computingTime
 total computing time at current moment
double currentTime
 time at current moment
double dt
 integration step
std::unique_ptr< mml::MonitoringIn > mmlIn
 Object representing manager in the file generated by xsdcxx, can be used for serialization.
std::vector< Monitor * > monitors
 Vector that contains all monitors.
double refresh
 refreshing step
Simulatorsimul
 the simulator used for simualtion
std::string simulatorName
 name of the simulator
int step
 current step
double stepComputingTime
 computing time of last step
std::vector< mml::TimeStep * > times
 Vector that contains information saved by saveMonitors method.

Detailed Description

Manager of the benchmark tests.

Do simulation loop and tests

Constructor & Destructor Documentation

◆ MonitoringManager()

◆ ~MonitoringManager()

MonitoringManager::~MonitoringManager ( )
virtual

destructor

References monitors, and times.

Member Function Documentation

◆ addMonitor()

void MonitoringManager::addMonitor ( Monitor * monitor)

add a monitor to the list

References monitors.

Referenced by checkStop().

◆ checkStop()

◆ deleteMonitor()

void MonitoringManager::deleteMonitor ( const unsigned int i)

delete a monitor and remove it from the list using its index

References monitors.

Referenced by checkStop().

◆ doMove()

virtual void MonitoringManager::doMove ( )
pure virtual

Do one step of simulation and save monitors for this step.

Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.

Referenced by simulate().

◆ end()

virtual void MonitoringManager::end ( )
pure virtual

End manager.

Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.

References simulate().

◆ getComputingTime()

double MonitoringManager::getComputingTime ( )

References computingTime.

Referenced by checkStop().

◆ getCurrentStep()

double MonitoringManager::getCurrentStep ( )

References step.

Referenced by checkStop().

◆ getCurrentTime()

double MonitoringManager::getCurrentTime ( )

References currentTime.

Referenced by checkStop().

◆ getDt()

double MonitoringManager::getDt ( )

References dt.

Referenced by checkStop().

◆ getInitPml()

PhysicalModel * MonitoringManager::getInitPml ( )

Referenced by checkStop().

◆ getLml()

Loads * MonitoringManager::getLml ( )

Referenced by checkStop(), and takeLml().

◆ getLmlFileName()

string MonitoringManager::getLmlFileName ( )

Referenced by checkStop().

◆ getmmlFileFolder()

string MonitoringManager::getmmlFileFolder ( )

Referenced by checkStop(), and Reference::Reference().

◆ getMmlFileName()

string MonitoringManager::getMmlFileName ( )

Referenced by checkStop().

◆ getMonitor()

Monitor * MonitoringManager::getMonitor ( const unsigned int i) const

get a monitor by its index in the list

References monitors.

Referenced by checkStop().

◆ getOldPosition()

void MonitoringManager::getOldPosition ( double pos[3],
unsigned int index )

get atom position for precedent step

Referenced by checkStop().

◆ getPml()

PhysicalModel * MonitoringManager::getPml ( )

Referenced by checkStop(), and takePml().

◆ getPmlFileName()

std::string MonitoringManager::getPmlFileName ( )

Referenced by checkStop(), and writeOutput().

◆ getRefresh()

double MonitoringManager::getRefresh ( )

References refresh.

Referenced by checkStop().

◆ getSimulator()

Simulator * MonitoringManager::getSimulator ( )

References simul.

Referenced by checkStop().

◆ getStepComputingTime()

double MonitoringManager::getStepComputingTime ( )

References stepComputingTime.

Referenced by checkStop().

◆ incStep()

void MonitoringManager::incStep ( )

◆ init()

virtual bool MonitoringManager::init ( )
pure virtual

Initialize manager.

Returns
false if initialisation faild

Implemented in InteractiveMonitoringManager, and NonInteractiveMonitoringManager.

Referenced by reload(), rewind(), and simulate().

◆ isLmlPresent()

bool MonitoringManager::isLmlPresent ( )

check if a lml is present

References mmlIn.

Referenced by checkStop(), and MonitoringManager().

◆ isPmlPresent()

bool MonitoringManager::isPmlPresent ( )

check if a scn is present instead of pmlFileName

References mmlIn.

Referenced by checkStop(), and MonitoringManager().

◆ numberOfMonitor()

unsigned int MonitoringManager::numberOfMonitor ( ) const

get the number of monitors stored in the list

References monitors.

Referenced by checkStop().

◆ reload()

void MonitoringManager::reload ( bool delPml = true)

reload simulation with current parameters

Parameters
delPmltrue if pml object have to be deleted (perhaps used by others: physicalModel component...)

References computingTime, currentTime, init(), step, stepComputingTime, and times.

Referenced by checkStop().

◆ rewind()

void MonitoringManager::rewind ( )

Rewind simulation.

References computingTime, currentTime, init(), step, stepComputingTime, and times.

Referenced by checkStop().

◆ saveMmlIn()

void MonitoringManager::saveMmlIn ( const char * fileName)

save current version of mml in

References mmlIn.

Referenced by checkStop().

◆ saveMonitors()

void MonitoringManager::saveMonitors ( )

◆ setCurrentTime()

void MonitoringManager::setCurrentTime ( double time)

mutators for simulation parameters

References currentTime.

Referenced by checkStop().

◆ setDt()

void MonitoringManager::setDt ( double dt)

change dt and save modification into mmlIn

References dt, and mmlIn.

Referenced by checkStop().

◆ setLmlFileName()

void MonitoringManager::setLmlFileName ( const char * file)

change lml file name and save modification into mmlIn

References mmlIn.

Referenced by checkStop().

◆ setPmlFileName()

void MonitoringManager::setPmlFileName ( const char * file)

change pml file name and save modification into mmlIn

References mmlIn.

Referenced by checkStop().

◆ setRefresh()

void MonitoringManager::setRefresh ( double refresh)

change refresh and save modification into mmlIn

References mmlIn, and refresh.

Referenced by checkStop().

◆ simulate()

void MonitoringManager::simulate ( )

perform simulation loop, make tests and save monitors' data into output file

References checkStop(), computingTime, currentTime, doMove(), init(), saveMonitors(), step, and writeOutput().

Referenced by end().

◆ storeOldPositions()

void MonitoringManager::storeOldPositions ( )

store old positions before next step

Referenced by checkStop().

◆ takeLml()

Loads * MonitoringManager::takeLml ( )

This is nearly the same as getLml(), but it also transfers ownership of the pointer.

After this method is called, this instance of MonitoringManager will not delete the pml. It is then the responsability of the caller (the instance which is taking ownership of the Loads). This is useful when transmitting to PMManagerDC's Loads manager for example.

References getLml().

Referenced by checkStop().

◆ takePml()

PhysicalModel * MonitoringManager::takePml ( )

This is nearly the same as getPml(), but it also transfers ownership of the pointer.

After this method is called, this instance of MonitoringManager will not delete the pml. It is then the responsability of the caller (the instance which is taking ownership of the PhysicalModel). This is useful when transmitting to PMManagerDC Component for example.

References getPml().

Referenced by checkStop().

◆ updateComputingTime()

void MonitoringManager::updateComputingTime ( )

add step computing time to total computing time

References computingTime, and stepComputingTime.

Referenced by checkStop(), and InteractiveMonitoringManager::doMove().

◆ updateCurrentTime()

void MonitoringManager::updateCurrentTime ( )

add dt to current time

References currentTime, and dt.

Referenced by checkStop(), and InteractiveMonitoringManager::doMove().

◆ writeCsv()

void MonitoringManager::writeCsv ( const char * fileName)

Write all saved monitors'state into csv file.

References monitors, and times.

Referenced by checkStop().

◆ writeOutput()

void MonitoringManager::writeOutput ( const char * fileName)

Write all saved monitors' states into mmlOut file.

References getPmlFileName(), and times.

Referenced by checkStop(), and simulate().

Member Data Documentation

◆ computingTime

double MonitoringManager::computingTime
protected

total computing time at current moment

Referenced by getComputingTime(), MonitoringManager(), reload(), rewind(), simulate(), and updateComputingTime().

◆ currentTime

double MonitoringManager::currentTime
protected

◆ dt

double MonitoringManager::dt
protected

◆ mmlIn

std::unique_ptr<mml::MonitoringIn> MonitoringManager::mmlIn
protected

Object representing manager in the file generated by xsdcxx, can be used for serialization.

Referenced by InteractiveMonitoringManager::InteractiveMonitoringManager(), isLmlPresent(), isPmlPresent(), MonitoringManager(), saveMmlIn(), saveMonitors(), setDt(), setLmlFileName(), setPmlFileName(), and setRefresh().

◆ monitors

std::vector<Monitor*> MonitoringManager::monitors
protected

Vector that contains all monitors.

Referenced by addMonitor(), deleteMonitor(), getMonitor(), numberOfMonitor(), saveMonitors(), writeCsv(), and ~MonitoringManager().

◆ refresh

double MonitoringManager::refresh
protected

refreshing step

Referenced by checkStop(), getRefresh(), MonitoringManager(), and setRefresh().

◆ simul

Simulator* MonitoringManager::simul
protected

◆ simulatorName

std::string MonitoringManager::simulatorName
protected

name of the simulator

Referenced by MonitoringManager().

◆ step

◆ stepComputingTime

double MonitoringManager::stepComputingTime
protected

◆ times

std::vector<mml::TimeStep*> MonitoringManager::times
protected

Vector that contains information saved by saveMonitors method.

Referenced by reload(), rewind(), saveMonitors(), writeCsv(), writeOutput(), and ~MonitoringManager().


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