OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::climate::MovingAvg7 Struct Reference

#include <Climate.hpp>

Collaboration diagram for openswmm::climate::MovingAvg7:

Public Member Functions

void push (double t_avg, double t_range)
 Append a daily temperature/range pair to the seven-slot circular history.
 
double avg_temp () const
 Read the arithmetic mean of retained daily temperature samples.
 
double avg_range () const
 Read the arithmetic mean of retained daily temperature ranges.
 

Public Attributes

double ta [7] = {}
 Daily average temps (deg F)
 
double tr [7] = {}
 Daily temp ranges (deg F)
 
int front = 0
 Circular buffer write index.
 
int count = 0
 Number of values stored (max 7)
 

Member Function Documentation

◆ avg_range()

double openswmm::climate::MovingAvg7::avg_range ( ) const

Read the arithmetic mean of retained daily temperature ranges.

Returns
Fahrenheit difference over count entries, or zero when count==0. Requires count [0,7]; no finite/nonnegative filtering or history mutation occurs.
Here is the caller graph for this function:

◆ avg_temp()

double openswmm::climate::MovingAvg7::avg_temp ( ) const

Read the arithmetic mean of retained daily temperature samples.

Returns
Fahrenheit mean over count entries, or zero when count==0. Requires valid count [0,7]; no filtering of negative/nonfinite values or history mutation occurs.
Here is the caller graph for this function:

◆ push()

void openswmm::climate::MovingAvg7::push ( double t_avg,
double t_range )

Append a daily temperature/range pair to the seven-slot circular history.

Parameters
t_avgFinite daily mean Fahrenheit, stored without validation/conversion.
t_rangeFinite daily Fahrenheit range, normally nonnegative; stored unchanged. Requires front in [0,6], count in [0,7]. Replaces oldest values after seven pushes, advances front modulo seven and caps count. No calendar/deduplication check; caller invokes once per desired sample and serializes access.
Here is the caller graph for this function:

Member Data Documentation

◆ count

int openswmm::climate::MovingAvg7::count = 0

Number of values stored (max 7)

◆ front

int openswmm::climate::MovingAvg7::front = 0

Circular buffer write index.

◆ ta

double openswmm::climate::MovingAvg7::ta[7] = {}

Daily average temps (deg F)

◆ tr

double openswmm::climate::MovingAvg7::tr[7] = {}

Daily temp ranges (deg F)


The documentation for this struct was generated from the following files: