Irrigation District Model

class morl4water.core.models.irrigation_district.IrrigationDistrict(name: str, all_demand: list[float], objective_function, objective_name: str, normalize_objective: float = 0.0)

Bases: Facility

Represents an irrigation district with specific water demand, consumption, and deficit tracking.

name

Identifier for the irrigation district.

Type:

str

all_demand

Monthly water demand values for the irrigation district.

Type:

list[float]

total_deficit

Cumulative water deficit experienced by the district over time.

Type:

float

all_deficit

Monthly record of deficits, calculated as demand minus consumption.

Type:

list[float]

normalize_objective

Normalization factor for the objective function reward. It should be the highest monthly value in a year. Default is 0.0

Type:

float

determine_consumption() float

Calculates the water consumption for the irrigation district based on current demand and inflow.

Returns:

Water consumption for the current timestep.

Return type:

float

determine_deficit() float

Calculates the reward (irrigation deficit) given the values of its attributes

Returns:

Water deficit of the irrigation district

Return type:

float

determine_info() dict

Returns information about the irrigation district.

Returns:

A dictionary containing key metrics for the district.

Return type:

dict

determine_reward() float

Calculates the reward for the irrigation district based on the objective function.

Returns:

Reward as calculated by the objective function.

Return type:

float

get_current_demand() float

Returns the demand value for the current timestep.

Returns:

Demand for the current timestep.

Return type:

float

is_truncated() bool

Checks if the simulation has reached the end of the demand data.

Returns:

True if the simulation has no more demand data to process, False otherwise.

Return type:

bool

reset() None

Resets the irrigation district’s deficit attributes and inherited attributes.

Returns:

None