41 #ifndef __OPENFLUID_MACHINE_INJECTGENERATOR_HPP__
42 #define __OPENFLUID_MACHINE_INJECTGENERATOR_HPP__
57 template<
class T=
double,
class TV=openflu
id::core::DoubleValue>
73 m_SourcesFile(
""),m_DistriFile(
""), m_DistriBindings(nullptr)
81 if (m_DistriBindings !=
nullptr)
83 delete m_DistriBindings;
91 if (!OPENFLUID_GetWareParameter(Params,
"sources",m_SourcesFile))
94 "missing sources value for generator");
97 if (!OPENFLUID_GetWareParameter(Params,
"distribution",m_DistriFile))
100 "missing distribution value for generator");
107 std::string InputDir;
109 OPENFLUID_GetRunEnvironment(
"dir.input",InputDir);
111 DistriTables.
build(InputDir,m_SourcesFile,m_DistriFile);
135 OPENFLUID_InitializeVariable(LU,m_VarName,Value);
163 OPENFLUID_AppendVariable(LU,m_VarName,Value);
185 template<
class T=
double,
class TV=openflu
id::core::DoubleValue>
223 "threshold max value must be greater or equal "
224 "to threshold min value for generator");
262 return this->
Never();
#define OPENFLUID_UNITS_ORDERED_LOOP(unitsclass, unitptr)
Definition: LoopMacros.hpp:86
Definition: FrameworkException.hpp:51
Definition: SchedulingRequest.hpp:54
Class for management of date and time information.
Definition: DateTime.hpp:88
RawTime_t diffInSeconds(const DateTime &DT) const
Definition: SpatialUnit.hpp:111
UnitID_t getID() const
Definition: SpatialUnit.hpp:165
Definition: InjectGenerator.hpp:59
std::string m_DistriFile
Definition: InjectGenerator.hpp:65
void finalizeRun()
Definition: InjectGenerator.hpp:179
TV m_Default
Definition: InjectGenerator.hpp:62
void initParams(const openfluid::ware::WareParams_t &Params)
Definition: InjectGenerator.hpp:89
void prepareData()
Definition: InjectGenerator.hpp:104
openfluid::base::SchedulingRequest runStep()
Definition: InjectGenerator.hpp:151
openfluid::base::SchedulingRequest initializeRun()
Definition: InjectGenerator.hpp:117
~GenericInjectGenerator()
Definition: InjectGenerator.hpp:79
void checkConsistency()
Definition: InjectGenerator.hpp:115
GenericInjectGenerator()
Definition: InjectGenerator.hpp:72
std::string m_SourcesFile
Definition: InjectGenerator.hpp:64
openfluid::tools::SimpleDistributionBindings< T, TV > * m_DistriBindings
Definition: InjectGenerator.hpp:67
Definition: InjectGenerator.hpp:270
openfluid::base::SchedulingRequest runStep()
openfluid::base::SchedulingRequest initializeRun()
Definition: Generator.hpp:127
Definition: Generator.hpp:92
openfluid::core::UnitsClass_t m_UnitsClass
Definition: Generator.hpp:97
openfluid::core::VariableName_t m_VarName
Definition: Generator.hpp:95
Definition: InjectGenerator.hpp:187
NumericalInjectGenerator()
Definition: InjectGenerator.hpp:198
T m_Max
Definition: InjectGenerator.hpp:194
void initParams(const openfluid::ware::WareParams_t &Params)
Definition: InjectGenerator.hpp:203
openfluid::base::SchedulingRequest runStep()
Definition: InjectGenerator.hpp:228
bool m_IsMax
Definition: InjectGenerator.hpp:191
bool m_IsMin
Definition: InjectGenerator.hpp:190
void checkConsistency() override
Definition: InjectGenerator.hpp:218
T m_Min
Definition: InjectGenerator.hpp:193
openfluid::base::SchedulingRequest Duration(const openfluid::core::Duration_t &D) const
Definition: PluggableSimulator.hpp:404
openfluid::base::SchedulingRequest Never() const
Definition: PluggableSimulator.hpp:348
void OPENFLUID_AppendVariable(openfluid::core::SpatialUnit *UnitPtr, const openfluid::core::VariableName_t &VarName, const openfluid::core::Value &Val)
openfluid::core::StringValue OPENFLUID_GetWareParameter(const openfluid::ware::WareParams_t &Params, const openfluid::ware::WareParamKey_t &ParamName) const
openfluid::core::DateTime OPENFLUID_GetCurrentDate() const
#define OPENFLUID_API
Definition: dllexport.hpp:86
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:146
Definition: ApplicationException.hpp:47