model.general¶
Attributes¶
Classes¶
Create a collection of name/value pairs. |
|
This class represents a vehicle type, containing the technical parameters shared by all vehicles of this type. |
|
A vehicle is a concrete vehicle of a certain type. |
|
VehicleClasses allow a many-to-many relationship between vehicles and classes, which may be used for specifying |
|
The association table for the many-to-many relationship between vehicles and classes. |
|
The EventType can be used to filter for certain types of events. It is also used to determine the valid combinations |
|
An Event represents a signle event in the simulation. This does not necessary mean a point in time, but a process |
|
The Consumption table stores the energy consumption look-up-tables for each vehicle class. |
|
The Consumption table stores the energy consumption look-up-tables for each vehicle class. |
|
This class is designed for distinguishing between charging point at area or at station. |
Functions¶
|
A VehicleType may hav consumption xor consumption_lut, but not both. |
|
Module Contents¶
- class model.general.ScenarioType(*args, **kwds)¶
Bases:
enum.EnumCreate a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- SOURCE¶
- MUTATION¶
- SIMULATION¶
- class model.general.Scenario¶
Bases:
eflips.model.Base- __tablename__ = 'Scenario'¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Auto-incremented.
- parent_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the parent scenario. Foreign key to
Scenario.id.
- scenario_type: sqlalchemy.orm.Mapped[ScenarioType]¶
The type of Scenario. Used by django-simba.
- name: sqlalchemy.orm.Mapped[str]¶
A name for the scenario.
- name_short: sqlalchemy.orm.Mapped[str]¶
An optional short name for the scenario.
- description: sqlalchemy.orm.Mapped[str]¶
An optional description for the scenario. Can be used to store additional information about the scenario.
- created: sqlalchemy.orm.Mapped[datetime.datetime]¶
The time the scenario was created. Automatically set to the current time at creation.
- finished: sqlalchemy.orm.Mapped[datetime.datetime]¶
The time the simulation was finished. Automatically set to the current time at simulation end. Null if not yet finished.
- default_simba_options: str = '{"eta": false, "days": null, "mode": ["sim", "report"], "seed": 1, "config": null, "margin": 1,...¶
- simba_options: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The options for the simBA simulation. Stored as a JSON object.
- eflips_depot_options: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The options for the eflips-depot simulation. Stored as a JSON object.
- task_id: sqlalchemy.orm.Mapped[uuid.UUID]¶
The task id of the simulation. Automatically set to a UUID when a scenario is submitted for simulation.
- manager_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the manager. Only used in the django.simba project.
- tco_parameters: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The TCO (Total Cost of Ownership) parameters for the scenario analysis. Stored as a JSON object containing the following parameters:
Financial Parameters: - project_duration: Analysis period in years - interest_rate: Interest rate (value between 0 and 1) - inflation_rate: General inflation rate (value between 0 and 1)
Cost Parameters: - staff_cost: Cost per staff member per hour - energy_cost: Cost per kWh of energy - maint_cost: Maintenance cost per vehicle per kilometer - maint_infr_cost: Maintenance cost per charging point and year - taxes: Tax cost per vehicle and year - insurance: Insurance cost per vehicle
Price Escalation Factors (PEF): - pef_general: General price escalation factor (value between 0 and 1) - pef_wages: Wage price escalation factor (value between 0 and 1) - pef_energy: Energy price escalation factor (value between 0 and 1) - pef_insurance: Insurance price escalation factor (value between 0 and 1)
Note: Cost parameters can be set to null if not applicable to the analysis. Price escalation factors represent annual cost increase rates, not relative to inflation.
- vehicle_types: sqlalchemy.orm.Mapped[List[VehicleType]]¶
A list of vehicle types.
- battery_types: sqlalchemy.orm.Mapped[List[BatteryType]]¶
A list of battery types.
- vehicle_classes: sqlalchemy.orm.Mapped[List[VehicleClass]]¶
- lines: sqlalchemy.orm.Mapped[List[eflips.model.Line]]¶
A list of lines.
- routes: sqlalchemy.orm.Mapped[List[eflips.model.Route]]¶
A list of routes.
- stations: sqlalchemy.orm.Mapped[List[eflips.model.Station]]¶
- assoc_route_stations: sqlalchemy.orm.Mapped[List[eflips.model.AssocRouteStation]]¶
A list of stations.
- stop_times: sqlalchemy.orm.Mapped[List[eflips.model.StopTime]]¶
A list of stop times.
- trips: sqlalchemy.orm.Mapped[List[eflips.model.Trip]]¶
A list of trips.
- rotations: sqlalchemy.orm.Mapped[List[eflips.model.Rotation]]¶
A list of events.
- consumption_luts: sqlalchemy.orm.Mapped[List[ConsumptionLut]]¶
- temperatures: sqlalchemy.orm.Mapped[List[Temperatures]]¶
- depots: sqlalchemy.orm.Mapped[List[eflips.model.Depot]]¶
A list of depots.
- plans: sqlalchemy.orm.Mapped[List[eflips.model.Plan]]¶
A list of plans.
- areas: sqlalchemy.orm.Mapped[List[eflips.model.Area]]¶
A list of areas.
- processes: sqlalchemy.orm.Mapped[List[eflips.model.Process]]¶
A list of processes.
- assoc_plan_processes: sqlalchemy.orm.Mapped[List[eflips.model.AssocPlanProcess]]¶
- charging_point_types: sqlalchemy.orm.Mapped[List[ChargingPointType]]¶
A list of charging point types.
- static _copy_object(obj, session, scenario)¶
Internal helper function to copy an SQLAlchemy object and attach it to a new scenario. :param obj: An SQLAlchemy object. Must have an ‘id’ attribute and a ‘scenario’ attribute. :param session: an SQLAlchemy session. :return: The new object, attached to the new scenario.
- Parameters:
obj (Any)
session (sqlalchemy.orm.Session)
scenario (Scenario)
- Return type:
None
- clone(session)¶
Creates a copy of the scenario, including all vehicle types and battery types. :param session: The database session. :return: The copy of the scenario.
- Parameters:
session (sqlalchemy.orm.Session)
- Return type:
- select_rotations(session, start_time, time_window)¶
Keeps only the rotations that are within the time window. Deletes all other rotations from the database. This method is useful if (for example) your import gave you a six-month schedule, but you only want to simulate a week of it.
- Parameters:
session (sqlalchemy.orm.Session) – An SQLAlchemy session to a database with eflips-model tables.
start_time (datetime.datetime) – The start time of the time window. Rotations that start before this time are not selected. This time must have a timezone.
time_window (datetime.timedelta) – The time window. Rotations that end after this time are not selected.
- Returns:
None
- Return type:
None
- __repr__()¶
- Return type:
str
- class model.general.VehicleType¶
Bases:
eflips.model.BaseThis class represents a vehicle type, containing the technical parameters shared by all vehicles of this type. It is used by vehicles (which are of a specific type) and by the rotations (which are for specific vehicle types).
- __tablename__ = 'VehicleType'¶
- _table_args_list = []¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle type. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- battery_type_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the battery type. Foreign key to
BatteryType.id.
- battery_type: sqlalchemy.orm.Mapped[BatteryType]¶
The battery type.
- name: sqlalchemy.orm.Mapped[str]¶
A name for the vehicle type.
- name_short: sqlalchemy.orm.Mapped[str]¶
An optional short name for the vehicle type.
- battery_capacity: sqlalchemy.orm.Mapped[float]¶
The battery capacity in kWh. This refers to the usable capacity, not the total capacity.
- battery_capacity_constraint¶
- battery_capacity_reserve: sqlalchemy.orm.Mapped[float]¶
The battery capacity reserve below 0 kWh ‘capacity’ in kWh. Using this value in generating evaluation, things such as “always 10% reserve” can be modeled.
- battery_capacity_reserve_constraint¶
- charging_curve: sqlalchemy.orm.Mapped[List[List[float]]]¶
The charging curve of the vehicle type. This is a 2D array of floats with two rows. The first row contains the state of charge, ranging from 0 (or some negative value if there is a nonzero reserve) to 1. The second row contains the charging power in kW. The charging curve is used to calculate the charging power of a vehicle using linear interpolation. The charging curve must be monotonically increasing in the first row.
- v2g_curve: sqlalchemy.orm.Mapped[List[List[float]]]¶
The vehicle-to-grid curve of the vehicle type. This is a 2D array of floats with two rows. The first row contains the state of charge, ranging from 0 to 1. The second row contains the discharging power in kW. The v2g curve is used to calculate the discharging power of a vehicle using linear interpolation. The v2g curve must be monotonically increasing in the first row. It may bo None if the vehicle type does not support vehicle-to-grid.
- charging_efficiency: sqlalchemy.orm.Mapped[float]¶
Ratio of battery output (while driving/V2G) to grid input. Also applies to V2G.
- charging_efficiency_constraint_lower¶
- charging_efficiency_constraint_upper¶
- opportunity_charging_capable: sqlalchemy.orm.Mapped[bool]¶
Whether the bus is capable of automatic highpower charging. All buses are assumed to be capable of (depot) conductive charging.
- minimum_charging_power: sqlalchemy.orm.Mapped[float]¶
If the charging power falls below this value, charging is canceled
- minimum_charging_power_constraint¶
- length: sqlalchemy.orm.Mapped[float]¶
The length of the vehicle in meters.
- width: sqlalchemy.orm.Mapped[float]¶
The width of the vehicle in meters.
- height: sqlalchemy.orm.Mapped[float]¶
The height of the vehicle in meters.
- empty_mass: sqlalchemy.orm.Mapped[float]¶
The empty mass of the vehicle in kg.
- empty_mass_constraint¶
- allowed_mass: sqlalchemy.orm.Mapped[float]¶
The allowed payload mass of the vehicle in kg. The total mass of the vehicle is empty_mass + allowed_mass.
- allowed_mass_constraint¶
- tco_parameters: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The TCO (Total Cost of Ownership) parameters of the vehicle type.
This parameter stores a JSON object containing the following fields: - “useful_life”: The expected operational lifetime of the vehicle in years - “procurement_cost”: The initial purchase cost per vehicle - “cost_escalation”: Annual cost escalation factor as a decimal between 0 and 1 (e.g., 0.02 represents 2% annual cost increase)
- consumption: sqlalchemy.orm.Mapped[float]¶
The vehicle’s energy consumption in kWh/km. This is used to calculate the energy consumption of a trip. Can be None if we are using more detailed consumption models.
Either this or consumption_lut must be specified. Both cannot exist at the same time.
- vehicle_classes: sqlalchemy.orm.Mapped[List[VehicleClass]]¶
A list of vehicle classes.
- rotations: sqlalchemy.orm.Mapped[List[eflips.model.Rotation]]¶
A list of rotations.
- areas: sqlalchemy.orm.Mapped[List[eflips.model.Area]]¶
A list of areas.
- assoc_vehicle_type_vehicle_classes: sqlalchemy.orm.Mapped[AssocVehicleTypeVehicleClass]¶
- __table_args__ = ()¶
- __repr__()¶
- Return type:
str
- model.general.check_vehicle_type_before_commit(_, __, target)¶
A VehicleType may hav consumption xor consumption_lut, but not both.
- Parameters:
target (VehicleType) – A VehicleType object
_ (Any)
__ (Any)
- Returns:
Nothing. Raises an exception if something is wrong.
- Return type:
None
- class model.general.BatteryType¶
Bases:
eflips.model.Base- __tablename__ = 'BatteryType'¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the battery type. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- vehicle_types: sqlalchemy.orm.Mapped[List[VehicleType]]¶
- specific_mass: sqlalchemy.orm.Mapped[float]¶
The specific mass of the battery in kg/kWh. Relative to gross (not net) capacity.
- chemistry: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The chemistry of the battery. Stored as a JSON object, defined by eflips-LCA
- tco_parameters: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The Total Cost of Ownership (TCO) parameters for the battery type.
Stored as a JSON object containing the following fields:
useful_life (int): The expected operational lifespan of the battery in years. Represents how long the battery is expected to maintain acceptable performance before requiring replacement.
procurement_cost (float or null): The initial acquisition cost per kWh of battery capacity.
cost_escalation (float): The annual rate of cost change as a decimal between 0 and 1. Negative values indicate cost reductions over time, while positive values indicate cost increases. For example, -0.03 represents a 3% annual cost reduction.
- __repr__()¶
- Return type:
str
- class model.general.Vehicle¶
Bases:
eflips.model.BaseA vehicle is a concrete vehicle of a certain type.
- __tablename__ = 'Vehicle'¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the battery type. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- vehicle_type_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle type. Foreign key to
VehicleType.id.
- vehicle_type: sqlalchemy.orm.Mapped[VehicleType]¶
The vehicle type.
- name: sqlalchemy.orm.Mapped[str]¶
A name for the vehicle.
- name_short: sqlalchemy.orm.Mapped[str]¶
An optional short name for the vehicle.
- rotations: sqlalchemy.orm.Mapped[List[eflips.model.Rotation]]¶
A list of rotations this vehicle is used for.
- __repr__()¶
- Return type:
str
- class model.general.VehicleClass¶
Bases:
eflips.model.BaseVehicleClasses allow a many-to-many relationship between vehicles and classes, which may be used for specifying things such as “any 12m bus” or “any 18m bus”.
The VehicleClass table is not used directly, but through the association table AssocVehicleTypeVehicleClass.
Support is currently incomplete. THis only exists as a stub (and is used by eflip-LCA), but is not implemented in django.simba or eflips-depot
- __tablename__ = 'VehicleClass'¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the battery type. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- name: sqlalchemy.orm.Mapped[str]¶
A name for the vehicle class.
- name_short: sqlalchemy.orm.Mapped[str]¶
An optional short name for the vehicle class.
- vehicle_types: sqlalchemy.orm.Mapped[List[VehicleType]]¶
- consumption_lut: sqlalchemy.orm.Mapped[ConsumptionLut]¶
A consumption look up table.
Either this or consumption must be specified. Both cannot exist at the same time.
- assoc_vehicle_type_vehicle_classes: sqlalchemy.orm.Mapped[AssocVehicleTypeVehicleClass]¶
- __repr__()¶
- Return type:
str
- class model.general.AssocVehicleTypeVehicleClass¶
Bases:
eflips.model.BaseThe association table for the many-to-many relationship between vehicles and classes.
- __tablename__ = 'AssocVehicleTypeVehicleClass'¶
- id: sqlalchemy.orm.Mapped[int]¶
Not the primary key and not used in SQLAlchemy, but required by Django.
- vehicle_type_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle type. Foreign key to
VehicleType.id.
- vehicle_type: sqlalchemy.orm.Mapped[VehicleType]¶
- vehicle_class_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle class. Foreign key to
VehicleClass.id.
- vehicle_class: sqlalchemy.orm.Mapped[VehicleClass]¶
- __repr__()¶
- Return type:
str
- class model.general.EventType(*args, **kwds)¶
Bases:
enum.EnumThe EventType can be used to filter for certain types of events. It is also used to determine the valid combinations of nullable fields in the Event table.
- DRIVING¶
Driving on a trip.
- CHARGING_OPPORTUNITY¶
Charging at a terminal station.
- CHARGING_DEPOT¶
Charging at a depot.
- SERVICE¶
Service at a depot. Probably, the description field should be used to specify the type of service.
- STANDBY¶
Standing in the depot while waiting for something. Not yet ready for departure.
- STANDBY_DEPARTURE¶
Ready for departure from a depot.
- PRECONDITIONING¶
HVAC is turned on using grid power.
- class model.general.Event¶
Bases:
eflips.model.BaseAn Event represents a signle event in the simulation. This does not necessary mean a point in time, but a process during which something happens. For example, there are charging and driving events. Events are used to track the state of the simulation. They are also the basis for the evaluation of the simulation.
Note that there are only certain valid combinations of the nullable fields. An event can take place either at a - station (station_id is not null and subloc_no is not null). Possible events: CHARGING_OPPORTUNITY - depot (station_id is not null and subloc_no is null). Possible events: CHARGING_DEPOT, SERVICE, STANDBY_DEPARTURE PRECONDITIONING - trip (trip_id is not null and subloc_no is null). Possible events: DRIVING
- __tablename__ = 'Event'¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the event. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- vehicle_type_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle type. Foreign key to
VehicleType.id.
- vehicle_type: sqlalchemy.orm.Mapped[VehicleType]¶
- vehicle_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle. Foreign key to
Vehicle.id.
- station_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the station. Foreign key to
Station.id.
- station: sqlalchemy.orm.Mapped[eflips.model.Station]¶
- area_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the area in the depot. Foreign key to
Area.id.
- area: sqlalchemy.orm.Mapped[eflips.model.Area]¶
- subloc_no: sqlalchemy.orm.Mapped[int]¶
The number of the sub-location in the depot or multi-chargpoint terminal. The mapping of sub-locations to physical locations is defined by the depot layout and/or the multi-chargpoint terminal layout.
- trip_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the trip. Foreign key to
Trip.id.
- trip: sqlalchemy.orm.Mapped[eflips.model.Trip]¶
- time_start: sqlalchemy.orm.Mapped[datetime.datetime]¶
The time the event starts.
- time_end: sqlalchemy.orm.Mapped[datetime.datetime]¶
The time the event ends.
- soc_start: sqlalchemy.orm.Mapped[float]¶
The state of charge at the start of the event. This should refer to the net battery capacity.
- soc_end: sqlalchemy.orm.Mapped[float]¶
The state of charge at the end of the event. This should refer to the net battery capacity.
- description: sqlalchemy.orm.Mapped[str]¶
A description of the event. Used to display additional information to the user.
- timeseries: sqlalchemy.orm.Mapped[Dict[str, List[datetime.datetime | str | float]]]¶
Dict with mandatory keys „time“ (ISO 18601 with TZ), „soc“ (0-1) and optional keys „distance“ (m, along route for trip) + other freely defined keys. Array of same length for each key
- __table_args__¶
- __repr__()¶
- Return type:
str
- model.general.postgresql_exclude¶
- model.general.check_event_before_commit(_, __, target)¶
1. If the event has a timeseries, check if the keys are correct. Also make sure the first timestamp is >= time_start and the last timestamp is <= time_end.
Check if the start or end time is not a full second, warn the user if it is not.
- Parameters:
target (Event) – an event object
_ (Any)
__ (Any)
- Returns:
Nothing. Raises an exception if something is wrong.
- Return type:
None
- class model.general.ConsumptionLut¶
Bases:
eflips.model.BaseThe Consumption table stores the energy consumption look-up-tables for each vehicle class.
Uses a regression model generated from real world electric bus data to create a consumption table in django-simba format (temperature, speed, level of loading, incline, consumption) and exports it into the session database.
- __tablename__ = 'ConsumptionLut'¶
- __table_args__¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the consumption. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- name¶
A name for the consumption table.
- vehicle_class_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the vehicle type. Foreign key to
VehicleClass.id.
- vehicle_class: sqlalchemy.orm.Mapped[VehicleClass]¶
The vehicle class.
- columns¶
A JSON-encoded list of column name strings. The order of these should match the order of the values for each row in the data_points
- data_points: sqlalchemy.orm.Mapped[List[List[float]]]¶
A list of data points. These are the coordinates of the data point. Its value is stored in the value column. The order of columns is the entry in the columns column.
- values: sqlalchemy.orm.Mapped[List[float]]¶
A list of consumption values in kWh/km. The corresponding temperatures, inclines etc. are stored in the data_points column.
- INCLINE = 'incline'¶
- T_AMB = 't_amb'¶
- LEVEL_OF_LOADING = 'level_of_loading'¶
- SPEED = 'mean_speed_kmh'¶
- CONSUMPTION = 'consumption_kwh_per_km'¶
- static calc_consumption(trip_distance, temperature, mass, duration)¶
This function calculates the consumption of the trip according to the model of Ji, Bie, Zeng, Wang https://doi.org/10.1016/j.commtr.2022.100069 :param trip_distance: Travelled distance in km :param temperature: Average temperature during trip in degrees Celsius :param mass: Curb weight + passengers in kg :param duration: Trip time in minutes :return: Trip energy in kWh
- Parameters:
trip_distance (float)
temperature (float)
mass (float)
duration (float)
- Return type:
float
- static table_generator(vehicle_type)¶
Takes VehicleType information to create a consumption table in django-simba format. :return:
- Parameters:
vehicle_type (VehicleType)
- Return type:
pandas.DataFrame
- static df_to_consumption_obj(df, scenario_or_id, vehicle_class_or_id)¶
- Parameters:
df (pandas.DataFrame)
scenario_or_id (Union[Scenario, int])
vehicle_class_or_id (Union[VehicleClass, int])
- Return type:
- classmethod from_vehicle_type(vehicle_type, vehicle_class)¶
- Parameters:
vehicle_type (VehicleType)
vehicle_class (VehicleClass)
- Return type:
- class model.general.Temperatures¶
Bases:
eflips.model.BaseThe Consumption table stores the energy consumption look-up-tables for each vehicle class.
Uses a regression model generated from real world electric bus data to create a consumption table in django-simba format (temperature, speed, level of loading, incline, consumption) and exports it into the session database.
- __tablename__ = 'Temperatures'¶
- __table_args__¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the consumption. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- name: sqlalchemy.orm.Mapped[str]¶
A name for the temperature table.
- use_only_time: sqlalchemy.orm.Mapped[bool]¶
Whether the temperature data is for one repeating day. If False, the temperature data is for multiple days. If true, it is for one day and all other days should use the values from this day.
- datetimes: sqlalchemy.orm.Mapped[List[datetime.datetime]]¶
The datetimes of the temperature data. If is_one_repeating_day is True, this should be a single day. The length of this list should be the same as the length of the temperatures.
- data: sqlalchemy.orm.Mapped[List[float]]¶
The temperatures in degrees Celsius. The order of the temperatures should match the order of the datetimes. The length of this list should be the same as the length of the datetimes.
- model.general.postgresql_array_check¶
- class model.general.ChargingPointType¶
Bases:
eflips.model.BaseThis class is designed for distinguishing between charging point at area or at station.
- __tablename__ = 'ChargingPointType'¶
- id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the charging point type. Auto-incremented.
- scenario_id: sqlalchemy.orm.Mapped[int]¶
The unique identifier of the scenario. Foreign key to
Scenario.id.
- name: sqlalchemy.orm.Mapped[str]¶
The name of the charging point type.
- name_short: sqlalchemy.orm.Mapped[str]¶
The short name of the charging point type (if available).
- tco_parameters: sqlalchemy.orm.Mapped[Dict[str, Any]]¶
The TCO (Total Cost of Ownership) parameters of the charging point.
Stored as a JSON object containing the following fields:
useful_life (int): Expected operational lifespan of the charging point in years. Default: 20 years
procurement_cost (float, optional): Initial purchase cost per charging point.
cost_escalation (float): Annual cost escalation rate as a decimal. Should be between 0.0 and 1.0 (e.g., 0.02 = 2% annual increase). Used to project future operational costs over the useful life period.
- stations: sqlalchemy.orm.Mapped[List[eflips.model.Station]]¶
The stations that have this charging point type.
- areas: sqlalchemy.orm.Mapped[List[eflips.model.Area]]¶
The areas that have this charging point type.
- __repr__()¶
- Return type:
str