Loading...
Searching...
No Matches
HydroCouple::Temporal Namespace Reference

HydroCouple's interfaces that have a time varying component. More...

Classes

class  IDateTime
 IDateTime interface based on a Julian day. More...
 
class  ITimeIdBasedComponentDataItem
 ITimeIdBasedComponentDataItem is an IComponentDataItem with both temporal and identifier-based dimensions for accessing multi-dimensional time-series data. More...
 
class  ITimeModelComponent
 ITimeModelComponent is an IModelComponent that advances through time during simulation and provides access to the current simulation time. More...
 
class  ITimeSeriesComponentDataItem
 ITimeSeriesComponentDataItem is an IComponentItem with a temporal attribute. More...
 
class  ITimeSpan
 ITimeSpan specifies an interval of time. More...
 

Enumerations

enum class  TimeKind : uint8_t {
  Unknown = 0 ,
  Instantaneous ,
  IntervalMean ,
  IntervalMinimum ,
  IntervalMaximum ,
  Accumulated
}
 What a value's time coordinate refers to. More...
 
enum class  TimeInterpolation : uint8_t {
  Unknown = 0 ,
  None ,
  Previous ,
  Nearest ,
  Linear
}
 How a provider produces a value at an instant that is between two it holds. More...
 
enum class  TimeExtrapolation : uint8_t {
  Unknown = 0 ,
  Refuse ,
  HoldLast ,
  Linear
}
 How a provider produces a value at an instant beyond the last (or before the first) it holds. More...
 

Variables

constexpr double TIME_EQUALITY_TOLERANCE_DAYS = 1.0e-8
 Two instants are the same instant when their Julian days differ by no more than this (1e-8 days, about 0.86 ms).
 
constexpr double INTERVAL_LENGTH_CONTIGUOUS = -1.0
 The intervalLength() a time-series item returns when its intervals are contiguous but not of one length (calendar months, an irregular record).
 

Detailed Description

HydroCouple's interfaces that have a time varying component.

Enumeration Type Documentation

◆ TimeExtrapolation

enum class HydroCouple::Temporal::TimeExtrapolation : uint8_t
strong

How a provider produces a value at an instant beyond the last (or before the first) it holds.

Enumerator
Unknown 

Not declared.

validate() must treat a connection whose two ends both say Unknown as an error.

Refuse 

A query outside the held range is refused; the provider must be advanced first.

HoldLast 

Repeat the boundary value.

Linear 

Extend the last two values linearly.

◆ TimeInterpolation

enum class HydroCouple::Temporal::TimeInterpolation : uint8_t
strong

How a provider produces a value at an instant that is between two it holds.

Enumerator
Unknown 

Not declared.

validate() must treat a connection whose two ends both say Unknown as an error.

None 

Exact match required (within TIME_EQUALITY_TOLERANCE_DAYS); a query at an instant not held is refused.

Previous 

Hold the most recent earlier value (step function).

Nearest 

The nearer of the two neighbours.

Linear 

Linear in time between neighbours.

◆ TimeKind

enum class HydroCouple::Temporal::TimeKind : uint8_t
strong

What a value's time coordinate refers to.

A time-series item carries times and values but does not say whether a value is a reading at that instant, a mean over the interval that ended there, or an accumulation. Those are three different numbers, and coupling a model that reports means to one that expects instants is wrong in a way that produces plausible output and no error.

It is not a hypothetical failure. A daily report in this ecosystem drifted from noon to five in the afternoon over a simulated year, aliasing a diurnal cycle into a seasonal signal, and it was found by checking a figure caption against its own timestamps rather than by anything in the data saying what the timestamps meant.

Enumerator
Unknown 

Not declared.

Consumers must not assume Instantaneous.

Instantaneous 

A reading at the time coordinate.

IntervalMean 

Mean over the interval ending at the time coordinate.

IntervalMinimum 

Minimum over that interval.

IntervalMaximum 

Maximum over that interval.

Accumulated 

Total accumulated over that interval.

Variable Documentation

◆ INTERVAL_LENGTH_CONTIGUOUS

double HydroCouple::Temporal::INTERVAL_LENGTH_CONTIGUOUS = -1.0
constexpr

The intervalLength() a time-series item returns when its intervals are contiguous but not of one length (calendar months, an irregular record).

Interval i then runs from time i-1 to time i, and interval 0 from the start of timeSpan(). Any negative intervalLength() has this meaning; this is the value to return.

◆ TIME_EQUALITY_TOLERANCE_DAYS

double HydroCouple::Temporal::TIME_EQUALITY_TOLERANCE_DAYS = 1.0e-8
constexpr

Two instants are the same instant when their Julian days differ by no more than this (1e-8 days, about 0.86 ms).

Time coordinates are Julian-day doubles. Near the present a double resolves a Julian day to about 40 µs, so instants computed on the two sides of a coupling (an accumulated step on one, a parsed timestamp on the other) rarely agree to the last bit. Every comparison the standard calls "exact" — TimeInterpolation::None, matching a consumer's times() against a provider's — uses this tolerance. It sits well above the resolution and below a millisecond, so no time step a coupling exchanges on collapses under it.