Features¶
This section presents the main features and functions to use in SimBEV.
simbev.car¶
simbev.mid_timeseries¶
simbev.plot¶
- simbev.plot.plot_gridtimeseries_by_usecase(simbev, grid_timeseries_all)¶
Create grid timeseries plots split by use case.
simbev.region¶
simbev.simbev_class¶
simbev.trip¶
- class simbev.trip.Trip(region: Region, car: Car, time_step, simbev: SimBEV, destination='', distance=0)¶
Bases:
objectRepresents a trip that a vehicle can make.
- Parameters:
region (Region) – Object where the trip happens.
car (Car) – Object of class Car.
time_step (int) – Current time-step
simbev (SimBEV) – Object that contains superior data.
destination (str) – Default is an empty string.
distance (float) – Default is 0.
- region¶
Object that contains information about the region.
- Type:
Region
- car¶
Object contains information about the vehicle.
- Type:
Car
- simbev¶
Object that contains superior data.
- Type:
SimBEV
- park_start¶
Time step where Trip gets initiated (start of parking event).
- Type:
int
- park_time¶
Number of time steps that the car parks.
- Type:
int
- drive_start¶
Time step where driving event starts.
- Type:
int
- drive_time¶
Number of time steps used to drive.
- Type:
int
- trip_end¶
Time step where driving concludes and trip ends.
- Type:
int
- drive_found¶
Checks if driving event is possible.
- Type:
bool
- destination¶
Purpose/destination of next driving event.
- Type:
str
- distance¶
Distance to drive.
- Type:
float
- speed¶
Average driving speed.
- Type:
float
- location¶
Current parking location (purpose).
- Type:
str
- create:
Finds next driving event and sets corresponding attributes.
- execute:
Sets car to execute the created trip.
- charge_decision(use_case)¶
Determine if a charging event is attractive enough.
- Parameters:
use_case (str) – Charging use case
- Return type:
bool
- create()¶
Creates new trip, starting from park_start. Calculates standing time, next destination and driving time.
- delay(time_steps: int)¶
Change the trip according to a given delay.
- Parameters:
time_steps (int) – Time steps to delay the start of the trip by
- Return type:
bool
- execute()¶
Executes created trip. Charging/parking and driving
- fit_trip_to_timerange()¶
Cuts off trip so it is inside the simulation time range.
- classmethod from_driving_profile(region: Region, car: Car, simbev: SimBEV)¶
Generate a list of Trip objects based on the driving profile of a car.
- Parameters:
region (Region) – A Region object representing the geographic region in which the Car operates.
car (Car) – A Car object for which to generate the list of Trip objects.
simbev (SimBEV) – A SimBEV object representing the EV simulation parameters.
- Returns:
A list of Trip objects representing the trips taken by the Car as defined in its driving profile.
- Return type:
list of Trip
- classmethod from_probability(region: Region, car: Car, time_step: int, simbev: SimBEV)¶
Generate a Trip object based on probability input data.
- Parameters:
region (Region) – A Region object representing the geographic region in which the Car operates.
car (Car) – A Car object for which to generate the Trip.
time_step (int) – An integer representing the time step at which to start the Trip.
simbev (SimBEV) – A SimBEV object representing the EV simulation parameters.
- Returns:
A Trip object representing the trip taken by the Car based on the probability of a trip occurring.
- Return type:
- get_max_parking_time(use_case)¶
Determine maximum parking time for this trip and a given use case.
- Parameters:
use_case (str) – Charging use case
- Returns:
maximum parking time in time steps
- Return type:
int
- property park_time_until_threshold: int¶
Returns time steps between park start and next threshold.
- Returns:
time steps until threshold time on the same day. returns 0 if negative
- Return type:
int
- simbev.trip.create_trip_from_profile_row(row, current_location, last_time_step, region, car, simbev, charging_use_case=None)¶
Create a Trip object based on information from a driving profile row.
This function takes various input parameters from a driving profile row and other context data to create a Trip object representing a driving trip. It calculates drive start time, drive time, destination, distance, parking time, and other attributes of the trip.
Parameters:¶
- rowpd.Series
A row of data from the profile containing information about the trip.
- current_locationstr
The current location of the vehicle.
- last_time_stepint
The time step of the last action taken by the vehicle.
- regionstr
The region in which the trip is taking place.
- carCar
The car involved in the trip.
- simbevSimBEV
An object representing the simulation environment.
- charging_use_casestr, optional
A string indicating the charging use case for the trip, if applicable.
Returns:¶
- Trip
A Trip object representing the created trip.
Notes:¶
The function calculates various attributes of the trip, such as drive start time, drive time, destination, distance, parking time, and more.
The fit_trip_to_timerange() method adjusts the trip to fit within the simulation time range.
The _set_timestamps() method sets the timestamps for the trip.