Class Iterator

Nested Relationships

Nested Types

Class Documentation

class Iterator

A class that controls how time steps are performed.

Public Types

typedef TimePoint::Clock Clock

Public Functions

Iterator() = delete
inline Iterator(Iterant &iterant)

Construct a new Iterator given a pointer to an Iterant.

void setStartStopStep(TimePoint startTime, TimePoint stopTime, Duration timestep)

Sets the time parameters as a start time, stop time and timestep length.

Parameters:
  • startTime – Start time point.

  • stopTime – Stop time point.

  • timestep – Timestep length.

void run()
class Iterant

A base class for classes that specify what happens during one timestep.

Subclassed by Nextsim::Counterant, Nextsim::IModelStep

Public Functions

Iterant() = default
Iterant(const Iterant &copyFrom) = default
Iterant &operator=(const Iterant &copyFrom) = default
Iterant(Iterant&&) = default
Iterant &operator=(Iterant&&) = default
virtual ~Iterant() = default
virtual void init() = 0

Initializes the model, based on some environment stored in the implementing class.

virtual void start(const TimePoint &startTime) = 0

Initializes the iterant based on the start time.

Parameters:

startTime – the time at the initialization of the iterant.

virtual void iterate(const TimestepTime &dt) = 0

Performs one iteration a specified length

Parameters:

dt – The length of the timestep.

virtual void stop(const TimePoint &stopTime) = 0

Finalizes the iterant based on the stop time.

Parameters:

stopTime – the time at the finalization of the iterant.