NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD::Schedule Class Reference

Detailed Description

Class Schedule defines scheduled parameters in sets of daily cycles.

Schedules are defined for a specific day type: week day, week end, holiday or all days. They contain one or more daily cycles that specify the distribution for different scheduled quantities over a period of one day. Holidays and week end days are defined in Schedules.

Definition at line 44 of file NANDRAD_Schedule.h.

#include <NANDRAD_Schedule.h>

Public Types

enum  ScheduledDayType {
  ST_ALLDAYS, ST_WEEKDAY, ST_WEEKEND, ST_MONDAY,
  ST_TUESDAY, ST_WEDNESDAY, ST_THURSDAY, ST_FRIDAY,
  ST_SATURDAY, ST_SUNDAY, ST_HOLIDAY, NUM_ST
}
 Different day types a schedule can be defined for. More...
 

Public Member Functions

NANDRAD_READWRITE void prepareCalculation ()
 Prepares calculation by initializing daily cycles and by collecting names of all scheduled parameters. More...
 
bool containsDay (unsigned int dayOfYear) const
 Returns true, if given day is inside the start and end date of the schedule. More...
 
bool isWholeYearSchedule () const
 Returns true if schedule is a whole year schedule (startDay = 0 and endDay = 364). More...
 

Public Attributes

ScheduledDayType m_type = NUM_ST
 Type of day this schedule is defined for. More...
 
unsigned int m_startDayOfTheYear = 0
 Start day of the year for the schedule, if not given, defaults to 0 = 1.1. More...
 
unsigned int m_endDayOfTheYear = 364
 End day for the schedule (includes the entire day), if not given, defaults 364 = 31.12. More...
 
std::vector< DailyCyclem_dailyCycles
 List of daily cycles that are used on day type specified above. More...
 
std::map< std::string, DailyCycle * > m_parameters
 All value names provided by all of the daily cycles. More...
 

Member Enumeration Documentation

◆ ScheduledDayType

Different day types a schedule can be defined for.

Warning
Do not change order of schedule definitions, since they mark also the lookup priority - for example, a holiday schedule takes precedence before a specific day schedule.

Definition at line 52 of file NANDRAD_Schedule.h.

Member Function Documentation

◆ prepareCalculation()

NANDRAD_READWRITE void NANDRAD::Schedule::prepareCalculation ( )

Prepares calculation by initializing daily cycles and by collecting names of all scheduled parameters.

Warning
In this function persistent pointers to memory locations are stored. Hence, you must not modify the memory location of this object or any of the vectors afterwards!

◆ containsDay()

bool NANDRAD::Schedule::containsDay ( unsigned int  dayOfYear) const
inline

Returns true, if given day is inside the start and end date of the schedule.

Definition at line 79 of file NANDRAD_Schedule.h.

◆ isWholeYearSchedule()

bool NANDRAD::Schedule::isWholeYearSchedule ( ) const
inline

Returns true if schedule is a whole year schedule (startDay = 0 and endDay = 364).

Definition at line 82 of file NANDRAD_Schedule.h.

Member Data Documentation

◆ m_type

ScheduledDayType NANDRAD::Schedule::m_type = NUM_ST

Type of day this schedule is defined for.

Definition at line 87 of file NANDRAD_Schedule.h.

◆ m_startDayOfTheYear

unsigned int NANDRAD::Schedule::m_startDayOfTheYear = 0

Start day of the year for the schedule, if not given, defaults to 0 = 1.1.

Definition at line 90 of file NANDRAD_Schedule.h.

◆ m_endDayOfTheYear

unsigned int NANDRAD::Schedule::m_endDayOfTheYear = 364

End day for the schedule (includes the entire day), if not given, defaults 364 = 31.12.

Definition at line 93 of file NANDRAD_Schedule.h.

◆ m_dailyCycles

std::vector<DailyCycle> NANDRAD::Schedule::m_dailyCycles

List of daily cycles that are used on day type specified above.

These cycles define different quantities/control parameters etc.

Definition at line 98 of file NANDRAD_Schedule.h.

◆ m_parameters

std::map<std::string, DailyCycle *> NANDRAD::Schedule::m_parameters

All value names provided by all of the daily cycles.

This map is composed during prepareCalculation() and primarily used to quickly check if this schedule provides a required parameter at all. Also, it identifies the actual schedule that defines this parameter.

Note
with this map we also ensure, that the user does not specify multiple daily cycles for the same parameter.

Definition at line 110 of file NANDRAD_Schedule.h.


The documentation for this class was generated from the following file: