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: object

Electric 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

boats

List of boats.

Type:

List[Boat]

chargers

List of chargers.

Type:

List[Charger]

pv_systems

List of PV systems.

Type:

List[PV]

bess_systems

List of BESS systems.

Type:

List[BESS]

tariff_path

Optional path to tariff JSON; if None, default_tariff.json is tried.

Type:

str | None

add_bess(bess: BESS) None[source]

Append a BESS to the port’s bess_systems list.

add_boat(boat: Boat) None[source]

Append a boat to the port’s boat list.

add_charger(charger: Charger) None[source]

Append a charger to the port’s charger list.

add_pv(pv: PV) None[source]

Append a PV system to the port’s pv_systems list.

bess_systems: List[BESS]
boats: List[Boat]
chargers: List[Charger]
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
pv_systems: List[PV]
property tariff: Dict | None

Loaded tariff data (from tariff_path); None if no tariff loaded.

tariff_path: str | None = None