![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Typedefs | |
| using | DateTime = double |
Functions | |
| void | divMod (int n, int d, int *result, int *remainder) |
| Integer divmod — matching legacy divMod(). | |
| bool | isLeapYear (int year) |
| Check if year is a leap year. | |
| DateTime | encodeDate (int year, int month, int day) |
| Encode year-month-day to DateTime. | |
| DateTime | encodeTime (int hour, int minute, int second) |
| Encode hour:minute:second to fractional day. | |
| void | decodeDate (DateTime date, int &year, int &month, int &day) |
| Decode DateTime to year-month-day. | |
| void | decodeTime (DateTime time, int &h, int &m, int &s) |
| Decode DateTime to hour:minute:second. | |
| DateTime | addSeconds (DateTime date, double seconds) |
| Add seconds to a DateTime — numerically identical to legacy. | |
| long | timeDiff (DateTime date1, DateTime date2) |
| Compute difference in seconds between two DateTimes. | |
| int | monthOfYear (DateTime date) |
| Get month of year (1..12) from DateTime. | |
| int | dayOfYear (DateTime date) |
| Get day of year (1..365/366) from DateTime. | |
| using openswmm::datetime::DateTime = typedef double |
Add seconds to a DateTime — numerically identical to legacy.
Decomposes time to integer H:M:S, adds seconds, recomposes. This decompose-recompose cycle is deterministic and produces the exact same floating-point result as the legacy engine.
|
inline |
Get day of year (1..365/366) from DateTime.
|
inline |
Decode DateTime to year-month-day.
|
inline |
Decode DateTime to hour:minute:second.
Uses floor(fracDay + 0.5) for rounding, matching legacy exactly. This integer decomposition is the key to deterministic date arithmetic.
|
inline |
|
inline |
Encode year-month-day to DateTime.
|
inline |
Encode hour:minute:second to fractional day.
|
inline |
Check if year is a leap year.
|
inline |
Get month of year (1..12) from DateTime.
Compute difference in seconds between two DateTimes.