Computer Assited Medical Intervention Tool Kit  version 5.0
InteractiveMonitoringManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef MANAGER_INTERACTIVEMANAGER_H
27 #define MANAGER_INTERACTIVEMANAGER_H
28 
29 #include "MMLAPI.h"
30 
31 #include <memory> // std::auto_ptr
32 #include <vector>
33 
34 // Monitor includes
35 #include "MonitoringManager.h"
36 #include <MonitorIn.hxx>
37 #include <MonitorOut.hxx>
38 
39 // Criterion includes
40 #include "StoppingCriterion.h"
41 
42 // Simulator includes
43 #include "InteractiveSimulator.h"
52 public:
58  InteractiveMonitoringManager(const char* mml);
59 
61  ~InteractiveMonitoringManager() override;
62 
64  bool init() override;
66  void end() override;
68  void doMove() override;
70  bool checkStop() override;
71 
73  StoppingCriterion* getStoppingCriterion();
74 
75 private:
77  StoppingCriterion* stop;
80 
81 
82 
83 };
84 
85 #endif // MANAGER_INTERACTIVEMANAGER_H
InteractiveSimulator::init
void init() override=0
initialize the simulator
InteractiveSimulator::end
void end() override=0
end simultor
Chrono
Elapsed real-time timer. Allows one to measure elapsed real time. You can start, stop,...
Definition: Chrono.h:40
InteractiveMonitoringManager::getStoppingCriterion
StoppingCriterion * getStoppingCriterion()
get Stopping Criterion
Definition: InteractiveMonitoringManager.cpp:100
MonitoringManager.h
InteractiveMonitoringManager.h
MonitoringManager::dt
double dt
integration step
Definition: MonitoringManager.h:170
InteractiveMonitoringManager::init
bool init() override
Initialize manager.
Definition: InteractiveMonitoringManager.cpp:64
Chrono.h
MML_API
#define MML_API
Definition: MMLAPI.h:43
MonitoringManager::saveMonitors
void saveMonitors()
Save save monitors' state for the current time.
Definition: MonitoringManager.cpp:200
MonitoringManager::end
virtual void end()=0
End manager.
MonitoringManager::updateComputingTime
void updateComputingTime()
add step computing time to total computing time
Definition: MonitoringManager.cpp:325
InteractiveMonitoringManager::doMove
void doMove() override
make a simulation move (one step)
Definition: InteractiveMonitoringManager.cpp:72
InteractiveMonitoringManager::stop
StoppingCriterion * stop
the stopping criteria to check in order to know when simulation loop should be stopped
Definition: InteractiveMonitoringManager.h:100
StoppingCriterion::checkCriterion
virtual bool checkCriterion()=0
return true if the stopping criterion is reach
Chrono::stop
double stop()
stop chrono
Definition: Chrono.cpp:117
StoppingCriterionFactory.h
InteractiveMonitoringManager::~InteractiveMonitoringManager
~InteractiveMonitoringManager() override
destructor
Definition: InteractiveMonitoringManager.cpp:52
InteractiveSimulator::doMove
virtual void doMove(double dt)=0
ask the simulator do to one step of the simulation
MonitoringManager::init
virtual bool init()=0
Initialize manager.
InteractiveSimulator
An interactive simulator is a simulator that we can control step by step (ex: Sofa)
Definition: InteractiveSimulator.h:38
MMLAPI.h
MonitoringManager::mmlIn
std::unique_ptr< mml::MonitoringIn > mmlIn
Object representing manager in the file generated by xsdcxx, can be used for serialization.
Definition: MonitoringManager.h:163
StoppingCriterion.h
InteractiveMonitoringManager::end
void end() override
End manager.
Definition: InteractiveMonitoringManager.cpp:85
MonitoringManager
Manager of the benchmark tests. Do simulation loop and tests.
Definition: MonitoringManager.h:50
MonitoringManager::doMove
virtual void doMove()=0
Do one step of simulation and save monitors for this step.
StoppingCriterion
class which represent the stopping criterion to check to stop simulation a StoppingCriterion is eithe...
Definition: StoppingCriterion.h:48
MonitoringManager::simul
Simulator * simul
the simulator used for simualtion
Definition: MonitoringManager.h:185
MonitoringManager::updateCurrentTime
void updateCurrentTime()
add dt to current time
Definition: MonitoringManager.cpp:319
InteractiveSimulator.h
InteractiveMonitoringManager::simul
InteractiveSimulator * simul
the simulator used for simualtion
Definition: InteractiveMonitoringManager.h:102
MonitoringManager::checkStop
virtual bool checkStop()=0
Check if simulation is finished.
Chrono::start
void start()
start at zero
Definition: Chrono.cpp:104
InteractiveMonitoringManager::checkStop
bool checkStop() override
check if the stopping criterion is reached
Definition: InteractiveMonitoringManager.cpp:90
Simulator::updatePositions
void updatePositions()
update all current positions and store last positions
Definition: Simulator.cpp:44
MonitoringManager::incStep
void incStep()
increment step by one
Definition: MonitoringManager.cpp:330
InteractiveMonitoringManager
Interactice managers are managers linked with an interactive simulator.
Definition: InteractiveMonitoringManager.h:51
MonitoringManager::stepComputingTime
double stepComputingTime
computing time of last step
Definition: MonitoringManager.h:181
StoppingCriterionFactory::createStoppingCriterion
static StoppingCriterion * createStoppingCriterion(mml::StoppingCriteria *s, MonitoringManager *monitoringManager, MultipleCriterion *parent=nullptr)
create a stopping criterion according to xsdcxx generated stopping criterion
Definition: StoppingCriterionFactory.cpp:32
InteractiveMonitoringManager::InteractiveMonitoringManager
InteractiveMonitoringManager(const char *mml)
constructor
Definition: InteractiveMonitoringManager.cpp:40