models.port module¶
Port model for the electric recreational port simulator.
- class models.port.Port(name: str, contracted_power: int, lat: float, lon: float, boats: List[Boat] = <factory>, chargers: List[Charger] = <factory>, pv_systems: List[PV] = <factory>, bess_systems: List[BESS] = <factory>, tariff_path: str | None = None)[source]¶
Bases:
objectElectric recreational port with boats, chargers, PV, BESS, and optional tariff.
- name¶
Port name.
- Type:
str
- contracted_power¶
Contracted power limit (kW).
- Type:
int
- lat¶
Latitude.
- Type:
float
- lon¶
Longitude.
- Type:
float
- tariff_path¶
Optional path to tariff JSON; if None, default_tariff.json is tried.
- Type:
str | None
- contracted_power: int¶
- get_tariff_price(timestamp: datetime) float[source]¶
Return electricity price per kWh for the given timestamp (15-minute resolution).
- Parameters:
timestamp – Time to look up.
- Returns:
Price per kWh, or 0.0 if no tariff or slot not found.
- lat: float¶
- lon: float¶
- name: str¶
- property tariff: Dict | None¶
Loaded tariff data (from tariff_path); None if no tariff loaded.
- tariff_path: str | None = None¶