VICUS Library
Documentation of Vicus library
|
#include <VICUS_Schedule.h>
Public Member Functions | |
VICUS_READWRITE_OVERRIDE VICUS_COMPARE_WITH_ID bool | isValid (std::string &err, bool checkAnnualScheds=false, const std::map< std::string, IBK::Path > &placeholder=std::map< std::string, IBK::Path >()) const |
bool | isValid () const |
bool | isSimilar (const Schedule &other) const |
Schedule | multiply (const Schedule &other) const |
Schedule | multiply (double val) const |
Schedule | add (const Schedule &other) const |
Schedule | add (double val) const |
void | createConstSchedule (double val=0) |
void | createYearDataVector (std::vector< double > &timepoints, std::vector< double > &data) const |
Schedule | createAnnualScheduleFromPeriodSchedule (std::string &name, const IBK::Unit &unit, unsigned int startDayOfYear=0) |
ComparisonResult | equal (const AbstractDBElement *other) const override |
void | insertIntoNandradSchedulegroup (const std::string &varName, std::vector< NANDRAD::Schedule > &scheduleGroup) const |
void | insertIntoNandradSchedulegroup (const std::string &varName, std::vector< NANDRAD::Schedule > &scheduleGroup, std::vector< NANDRAD::LinearSplineParameter > &splines, const std::map< std::string, IBK::Path > &placeholders=std::map< std::string, IBK::Path >()) const |
Public Member Functions inherited from VICUS::AbstractDBElement | |
AbstractDBElement ()=default | |
AbstractDBElement (unsigned int id, const IBK::MultiLanguageString &name) | |
virtual | ~AbstractDBElement () |
virtual void | readXML (const TiXmlElement *element)=0 |
virtual TiXmlElement * | writeXML (TiXmlElement *parent) const =0 |
void | collectChildren (std::set< const AbstractDBElement * > &allChildrenRefs) const |
void | collectLocalChildren (std::set< AbstractDBElement * > &localChildrenRefs) const |
const QString | sourceName () const |
Static Public Member Functions | |
static std::vector< NANDRAD::Schedule::ScheduledDayType > | mergeDayType (const std::vector< int > &dts) |
Public Attributes | |
IBK::MultiLanguageString | m_notes |
IBK::MultiLanguageString | m_dataSource |
bool | m_useLinearInterpolation = false |
bool | m_haveAnnualSchedule = false |
NANDRAD::LinearSplineParameter | m_annualSchedule |
std::vector< ScheduleInterval > | m_periods |
Public Attributes inherited from VICUS::AbstractDBElement | |
unsigned int | m_id = INVALID_ID |
IBK::MultiLanguageString | m_displayName |
QColor | m_color |
bool | m_builtIn = false |
bool | m_local = true |
std::set< AbstractDBElement * > | m_childrenRefs |
bool | m_isReferenced = false |
std::string | m_errorMsg |
Additional Inherited Members | |
Public Types inherited from VICUS::AbstractDBElement | |
enum | ComparisonResult { Equal , OnlyMetaDataDiffers , Different } |
Describes the course of a single scheduled quantity (basically a value over time data set). This schedule does not have a unit.
Multiply a schedule with another schedule. Returns the result schedule.
Schedule VICUS::Schedule::add | ( | double | val | ) | const |
Add a constant value to a schedule. Returns the result schedule.
Schedule VICUS::Schedule::createAnnualScheduleFromPeriodSchedule | ( | std::string & | name, |
const IBK::Unit & | unit, | ||
unsigned int | startDayOfYear = 0 |
||
) |
Creates an annual schedule from a period schedule.
name | -> name of quantity |
void VICUS::Schedule::createConstSchedule | ( | double | val = 0 | ) |
Create a constant schedule with value val.
void VICUS::Schedule::createYearDataVector | ( | std::vector< double > & | timepoints, |
std::vector< double > & | data | ||
) | const |
Create a data and a timepoint vector for the hole schedule. Only period based schedules.
|
overridevirtual |
Comparison operator
Implements VICUS::AbstractDBElement.
void VICUS::Schedule::insertIntoNandradSchedulegroup | ( | const std::string & | varName, |
std::vector< NANDRAD::Schedule > & | scheduleGroup | ||
) | const |
Generates NANDRAD schedules from data stored in this object and inserts these into the given schedule group. The variable to be inserted into the schedule group is given in parameter 'varName' (formatted including unit). Only period schedule are valid.
void VICUS::Schedule::insertIntoNandradSchedulegroup | ( | const std::string & | varName, |
std::vector< NANDRAD::Schedule > & | scheduleGroup, | ||
std::vector< NANDRAD::LinearSplineParameter > & | splines, | ||
const std::map< std::string, IBK::Path > & | placeholders = std::map<std::string, IBK::Path>() |
||
) | const |
Generates NANDRAD schedules from data stored in this object and inserts these into the given schedule group. The variable to be inserted into the schedule group is given in parameter 'varName' (formatted including unit).
bool VICUS::Schedule::isSimilar | ( | const Schedule & | other | ) | const |
Checks if two schedules encode the same physical behaviour, allowing for small rounding errors.
bool VICUS::Schedule::isValid | ( | ) | const |
Checks if all referenced schedule is valid. Only for period schedules.
bool VICUS::Schedule::isValid | ( | std::string & | err, |
bool | checkAnnualScheds = false , |
||
const std::map< std::string, IBK::Path > & | placeholder = std::map<std::string, IBK::Path>() |
||
) | const |
Checks if all referenced schedule is valid.
|
static |
Converts vector of VICUS day types into a NANDRAD schedule day types (also merges weekdays to NANDRAD::Schedule::ST_WEEKDAY, etc.).
Multiply a schedule with another schedule. Returns the result schedule.
Schedule VICUS::Schedule::multiply | ( | double | val | ) | const |
Multiply a schedule with constant value. Returns the result schedule.
NANDRAD::LinearSplineParameter VICUS::Schedule::m_annualSchedule |
Annual schedule data.
IBK::MultiLanguageString VICUS::Schedule::m_dataSource |
Data source.
bool VICUS::Schedule::m_haveAnnualSchedule = false |
If true, we have an annual schedule (though it might still be empty).
IBK::MultiLanguageString VICUS::Schedule::m_notes |
Notes.
std::vector<ScheduleInterval> VICUS::Schedule::m_periods |
Data is organized in periods of data. Periods in vector must be consecutive in time.
bool VICUS::Schedule::m_useLinearInterpolation = false |
If true, values are linearly interpolated between given time points. Applies to both daily cycle and annual schedules. Defaults to true.