config package

Submodules

Module contents

Configuration for the port simulator.

Exposes Settings (global simulator options) and SimulationMode (real-time vs batch).

class config.Settings(timestep: int = 900, mode: SimulationMode = SimulationMode.BATCH, db_path: str = 'port_simulation.db', use_optimizer: bool = False, power_limit_mode: bool = False, trip_schedule: tuple = ((9, 0), (14, 1)))[source]

Bases: object

Global settings for the port simulator.

timestep

Simulation timestep in seconds (default 900, i.e. 15 minutes).

Type:

int

mode

Simulation mode (real-time or batch).

Type:

config.settings.SimulationMode

db_path

Path to the SQLite database file.

Type:

str

use_optimizer

If True, use optimization for scheduling; if False, use rule-based control.

Type:

bool

power_limit_mode

If True, enforce contracted power limit without optimization (baseline); if False, charging is unlimited.

Type:

bool

trip_schedule

Trip departure times per day as a tuple of (hour_utc, slot_index); e.g. ((9, 0), (14, 1)) for 09:00 slot 0 and 14:00 slot 1.

Type:

tuple

db_path: str = 'port_simulation.db'
mode: SimulationMode = 'batch'
power_limit_mode: bool = False
timestep: int = 900
trip_schedule: tuple = ((9, 0), (14, 1))
use_optimizer: bool = False
class config.SimulationMode(value)[source]

Bases: Enum

Execution mode for the simulation (real-time or batch).

BATCH = 'batch'
REAL_TIME = 'real_time'