Computer Assisted Medical Intervention Tool Kit  version 5.2
 
Loading...
Searching...
No Matches
Criterion.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, 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 STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIA_H
27#define STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIA_H
28
29#include "MMLAPI.h"
30
31#include <vector>
32
33#include <MonitorIn.hxx>
34
35// Stopping criteria includes
36#include "StoppingCriterion.h"
37#include "Method.h"
48public:
53 Criterion(mml::Criteria* c, MonitoringManager* monitoringManager, MultipleCriterion* parent = nullptr);
55 ~Criterion() override;
56
58 bool checkCriterion() override;
59
61 int getNumberOfChildren() override;
62
64 StoppingCriterion* getChild(const unsigned int i) override;
65
67 std::string getName() override = 0;
68
70 std::string getMethodString();
71
73 std::string scopeToString();
74
75protected:
79 double factor;
81 std::vector<double> values;
83 virtual void calculate() = 0;
85 void write();
87 mml::Criteria* mappedObject;
89 std::string unit;
90
91};
92
93#endif // STOPPINGCRITERION_STOPPINGCRITERIA_CRITERIA_H
#define MML_API
Definition MMLAPI.h:43
Class which represents a simple criterion A criterion can be checked using checkCriterion method to k...
Definition Criterion.h:47
std::string unit
unit
Definition Criterion.h:89
virtual void calculate()=0
calculate stopping criteria data and store it into values vector
std::string getName() override=0
get stopping criterion name
std::vector< double > values
vector that stores current data of the stopping criteria
Definition Criterion.h:81
mml::Criteria * mappedObject
the xsdcxx object representing criterion, used for serialization
Definition Criterion.h:87
Method * meth
the computationnal method used to check if criterion is true
Definition Criterion.h:77
double factor
factor to multiplate for conversion to SI
Definition Criterion.h:79
A Method represent how to make the boolean assessment with criteria data (a vector of double)
Definition Method.h:42
Manager of the benchmark tests.
Definition MonitoringManager.h:50
class which represents a multiple criterion a multiple criterion is either an OrMUltipleCriterion or ...
Definition MultipleCriterion.h:45
class which represent the stopping criterion to check to stop simulation a StoppingCriterion is eithe...
Definition StoppingCriterion.h:48
virtual bool checkCriterion()=0
return true if the stopping criterion is reach
virtual int getNumberOfChildren()=0
get number of childre; return -1 for non multiple criteria
virtual StoppingCriterion * getChild(const unsigned int i)=0
get the child repered by index, return nullptr if no child