RUFAS.rufas_time module#

class RUFAS.rufas_time.RufasTime(start_date: datetime = None, end_date: datetime = None, current_date: datetime = None)#

Bases: object

__init__(start_date: datetime = None, end_date: datetime = None, current_date: datetime = None) None#

This object is responsible for creating and tracking time in the simulation.

advance() None#

Advances the time in the simulation by 1 day.

property year_start_day: int#

Returns the first Julian day of the current year in integer.

property year_end_day: int#

Returns the last Julian day of the current year in integer.

property current_julian_day: int#

Returns the current Julian day of the current year in integer.

property current_month: int#

Returns the current month in integer.

property current_simulation_year: int#

Returns the current simulation year in integer.

property current_calendar_year: int#

Returns the current calendar year in integer.

property simulation_day: int#

Returns the current simulation day in integer.

record_time() None#

Records the current day, simulated year, and calendar year of the simulation in the OutputManager.

convert_simulation_day_to_date(simulation_day: int) datetime#

Convert the simulation day to a date object that is relative to the start date of the simulation.

Parameters#

simulation_dayint

The simulation day to convert to a date object.

Returns#

date

The date object that corresponds to the simulation day.

static convert_year_jday_to_date(year: int, day: int) datetime#

Converts the year and its day of the year to a datetime object.

Parameters#

year: int

Year of the date.

day: int

Number of days into the year.

Returns#

datetime

The datetime object from the provided inputs.

convert_slice_to_simulation_day(slice_day: int) int#

Converts the slice day to a simulation day.

Parameters#

slice_day: int

The slice day to convert to a simulation day.

Returns#

int

The simulation day that corresponds to the slice day.