| """
|
| Contains model information regarding dates and step times etc.
|
|
|
| """
|
|
|
|
|
| class ClockStruct:
|
| """
|
| Contains model information regarding dates and step times etc.
|
|
|
| Attributes:
|
|
|
| time_step_counter (int): Keeps track of current timestep
|
|
|
| model_is_finished (Bool): False unless model has finished
|
|
|
| simulation_start_date (np.Datetime64): Date of simulation start
|
|
|
| simulation_end_date (np.Datetime64): Date of simulation end
|
|
|
| time_step (int): time step (evaluation needed
|
|
|
| n_steps (int): total number of days of simulation
|
|
|
| time_span (np.array): all dates that lie within the start and end dates of simulation
|
|
|
| step_start_time (np.Datetime64): Date at start of timestep
|
|
|
| step_end_time (np.Datetime64): Date at end of timestep
|
|
|
| evap_time_steps (int): Number of time-steps (per day) for soil evaporation calculation
|
|
|
| sim_off_season (str): 'Y' if you want to simulate the off season,'N' otherwise
|
|
|
| planting_dates (list-like): list of planting dates in datetime format
|
|
|
| harvest_dates (list-like): list of harvest dates in datetime format
|
|
|
| n_seasons (int): Total number of seasons to be simulated
|
|
|
| season_counter (int): counter to keep track of which season we are currenlty simulating
|
|
|
|
|
| """
|
|
|
| def __init__(self):
|
|
|
| self.time_step_counter = 0
|
| self.model_is_finished = False
|
| self.simulation_start_date = 0
|
| self.simulation_end_date = 0
|
| self.time_step = 0
|
| self.n_steps = 0
|
| self.time_span = (
|
| 0
|
| )
|
| self.step_start_time = 0
|
| self.step_end_time = 0
|
|
|
| self.evap_time_steps = 20
|
| self.sim_off_season = (
|
| "N"
|
| )
|
| self.planting_dates = (
|
| []
|
| )
|
| self.harvest_dates = []
|
| self.n_seasons = 0
|
| self.season_counter = -1
|
|
|