7#ifndef SRC_INCLUDE_ITERATOR_HPP
8#define SRC_INCLUDE_ITERATOR_HPP
18 typedef TimePoint::Clock Clock;
64 const std::string& durationStr,
const std::string& stepStr);
112 inline void init() {};
113 inline void start(
const TimePoint& startTime) {};
115 inline void stop(
const TimePoint& stopTime) {};
A base class for classes that specify what happens during one timestep.
virtual void init()=0
Initializes the model, based on some environment stored in the implementing class.
virtual void iterate(const TimestepTime &dt)=0
virtual void stop(const TimePoint &stopTime)=0
virtual void start(const TimePoint &startTime)=0
A simple Iterant that does nothing.
A class that controls how time steps are performed.
void run()
Run the Iterant over the specified time period.
TimePoint parseAndSet(const std::string &startTimeStr, const std::string &stopTimeStr, const std::string &durationStr, const std::string &stepStr)
Parses the four strings and sets the time parameters from them.
void setStartDurationStep(TimePoint startTime, Duration duration, Duration timestep)
Sets the time parameters as a start time, run length and timestep length.
static NullIterant nullIterant
A static instance of the NullIterant class.
void setStartStopStep(TimePoint startTime, TimePoint stopTime, Duration timestep)
Sets the time parameters as a start time, stop time and timestep length.
void setIterant(Iterant *iterant)
Sets the iterant to be iterated using a pointer.