### setup Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Executes setup functions necessary for the simulation. This includes creating user groups, car types, and regions from the input data. ```APIDOC ## setup() ### Description Run setup functions. This creates user groups, car types and regions from input data. ``` -------------------------------- ### Install Test Dependencies Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Install the necessary dependencies required for running tests locally. ```bash pip install -r tests/test_requirements.txt ``` -------------------------------- ### Install SimBEV using pip Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/getting_started.md Install the SimBEV package in editable mode using pip after setting up the virtual environment. ```bash pip install -e /local/path/to/simbev/ ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/rl-institut/simbev/blob/dev/README.md Create a Python virtual environment using virtualenv and activate it. Ensure Python version 3.8 or higher is installed. ```bash virtualenv --python=python3.8 simbev source simbev/bin/activate ``` -------------------------------- ### Create and Activate Conda Environment Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/getting_started.md Create a Conda environment named 'simbev' using the provided environment file and activate it. Requires Conda to be installed. ```bash conda create -n simbev /local/path/to/simbev/environment.yml conda activate simbev ``` -------------------------------- ### Create Release Branch Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Branch off from the 'dev' branch to start the release process. Replace X.Y.Z with the new version number. ```bash git checkout -b release/vX.Y.Z dev ``` -------------------------------- ### Run Default SimBEV Simulation Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/getting_started.md Execute the default simulation scenario using the SimBEV Python module. This command starts the simulation with default settings. ```bash python -m simbev ``` -------------------------------- ### Clone SimBEV Repository via HTTPS Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/getting_started.md Clone the SimBEV repository from GitHub using HTTPS. This method does not require SSH key setup. ```bash git clone https://github.com/rl-institut/simbev.git ``` -------------------------------- ### simbev.mid_timeseries.get_cutoff Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Determines the start date of the next season. ```APIDOC ## simbev.mid_timeseries.get_cutoff(date: date) Determines start date of next season. * **Parameters:** **date** (*date*) – Date of request. * **Returns:** **cutoff** – Start of next season. * **Return type:** date ``` -------------------------------- ### simbev.mid_timeseries.get_timeseries Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Retrieves processed MiD-data timeseries including trip start information. ```APIDOC ## simbev.mid_timeseries.get_timeseries(start: date, end: date, region, stepsize, data_directory) * **Parameters:** * **start** (*date*) – Start of simulation timeframe. * **end** (*date*) – End of simulation timeframe. * **region** (*str*) – Region. * **stepsize** (*int*) – Stepsize of simulation. * **data_directory** (*pathlib.Path*) – Path to probability data directory * **Returns:** **pd_result** – Timeseries of processed MiD-data, that includes amount of trips started by usecase and time. * **Return type:** DataFrame ``` -------------------------------- ### simbev.mid_timeseries.get_season_idx Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Gets the index of the season for a given date. ```APIDOC ## simbev.mid_timeseries.get_season_idx(date: date) Gets index of season. * **Parameters:** **date** (*date*) – Date requested. * **Returns:** **season** – Index of the season. * **Return type:** int ``` -------------------------------- ### Run SimBEV with a Scenario Source: https://github.com/rl-institut/simbev/blob/dev/README.md Execute the SimBEV simulation using a specified configuration file. Defaults to a predefined scenario if none is provided. ```bash python -m simbev path/to/config ``` ```bash python -m simbev scenarios/default/configs/default.cfg ``` -------------------------------- ### Create and Activate Conda Environment Source: https://github.com/rl-institut/simbev/blob/dev/README.md Create a Conda environment named 'simbev' using the provided environment file and activate it. ```bash conda env create -n simbev -f /local/path/to/simbev/environment.yml conda activate simbev ``` -------------------------------- ### SimBEV.from_config Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Creates a SimBEV object from a configuration file path. ```APIDOC #### *classmethod* from_config(config_path) ### Description Creates a SimBEV object from a config path string. ### Parameters: * **config_path** (*str*) – Path string pointing to the config file. ### Returns: * SimBEV - SimBEV object, that contains all Parameters needed for simulation. * cfg - ConfigParser Object for reading config files. ``` -------------------------------- ### SimBEV Class Initialization Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Initializes the SimBEV class with data and configuration dictionaries, and a name for the simulation. ```APIDOC ## class simbev.simbev_class.SimBEV(data_dict, config_dict, name) ### Description SimBEV is a class representing a simulation of Battery Electric Vehicles (BEV) behavior. ### Parameters: * **data_dict** (dict) - A dictionary containing various data parameters for the simulation. * **config_dict** (dict) - A dictionary containing configuration parameters for the simulation. * **name** (str) - A name or identifier for this simulation. ``` -------------------------------- ### Checkout Development Branch Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Switch back to the development branch. ```bash git checkout dev ``` -------------------------------- ### Create and Activate Python Virtual Environment Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/getting_started.md Create a Python virtual environment using venv and activate it. Requires Python 3.8 or higher. ```bash python3 -m venv venv source venv/bin/activate ``` -------------------------------- ### Run Simulation with Custom Scenario Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/usage_details.md Execute a SimBEV simulation using a specified configuration file for a custom scenario. Ensure your scenario directory and configuration files are correctly set up. ```shell python -m simbev scenarios/test/configs/minimal.cfg ``` -------------------------------- ### Run Simulation with Specified Path Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/usage_details.md Execute a SimBEV simulation by providing the path to the desired configuration file. This allows flexibility in choosing simulation parameters and data. ```bash python -m simbev path/to/config ``` -------------------------------- ### Checkout Release Branch Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Switch to the release branch to make changes. ```bash git checkout release/vX.Y.Z ``` -------------------------------- ### run Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Runs the simulation for a single region. It takes a region object as input and returns the grid data for that region. ```APIDOC ## run(region) ### Description Runs Simulation for single-processing. ### Parameters #### Path Parameters * **region** ([*Region*](#simbev.region.Region)) - Required - Includes all properties of current region. ### Returns DataFrame - Returns grid-data for current region. ``` -------------------------------- ### Run Pytest Integration/Unit Tests Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Execute integration and unit tests using the pytest framework. ```bash pytest tests ``` -------------------------------- ### Create a New Feature Branch Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Create a new branch from 'dev' to work on a feature. Use 'feature/' prefix for new features and 'fix/' for bug fixes. ```bash git checkout -b feature/myfeature dev ``` -------------------------------- ### Run Multiple Simulation Iterations Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/usage_details.md Specify the number of simulation iterations to run using the -r or --repeat argument. This is useful for analyzing variability or running multiple scenarios. ```bash python -m simbev -r ``` ```bash python -m simbev --repeat ``` -------------------------------- ### Run Pylint Linting Tests Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Perform linting checks using Pylint to ensure code quality and style compliance. ```bash pylint ``` -------------------------------- ### Update CHANGELOG.md for Release Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Update the CHANGELOG.md file by replacing the '[unreleased]' section with the new version number and release date, and add a new '[unreleased]' section. ```markdown ## [unreleased] ### Added - feature 1 - feature 2 ### Changed - thing 1 - thing 2 ### Removed - some stuff ``` ```markdown ## [unreleased] ### Added - ### Changed - ### Removed - ## [X.Y.Z] - 20**-**-** ### Added - feature 1 - feature 2 ### Changed - thing 1 - thing 2 ### Removed - some stuff ``` -------------------------------- ### Clone SimBEV Repository via SSH Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/getting_started.md Clone the SimBEV repository from GitHub using SSH. Ensure you have SSH keys configured. ```bash git clone git@github.com:rl-institut/simbev.git /local/path/to/simbev/ ``` -------------------------------- ### Run Flake8 Linting Tests Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Perform linting checks using Flake8 to ensure code style compliance. ```bash flake8 ``` -------------------------------- ### Trip Class Methods Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md This section covers the methods available on the Trip class for managing and executing trips. ```APIDOC ## charge_decision(use_case) ### Description Determine if a charging event is attractive enough. ### Parameters #### Path Parameters - **use_case** (str) - Required - Charging use case ### Returns - bool - True if the charging event is attractive, False otherwise. ``` ```APIDOC ## create() ### Description Creates a new trip, starting from the car's current park start location. This method calculates the standing time, next destination, and driving time for the trip. ``` ```APIDOC ## delay(time_steps) ### Description Adjusts the trip's start time by a specified number of time steps. ### Parameters #### Path Parameters - **time_steps** (int) - Required - The number of time steps to delay the start of the trip by. ### Returns - bool - True if the delay was applied successfully, False otherwise. ``` ```APIDOC ## execute() ### Description Executes the created trip, including charging, parking, and driving phases. ``` ```APIDOC ## fit_trip_to_timerange() ### Description Adjusts the trip to ensure it falls entirely within the simulation's defined time range. ``` ```APIDOC ## from_driving_profile(region, car, simbev) ### Description Generates a list of Trip objects based on the driving profile of a given car within a specified region and simulation environment. ### Parameters #### Path Parameters - **region** (Region) - Required - A Region object representing the geographic area. - **car** (Car) - Required - A Car object for which to generate trips. - **simbev** (SimBEV) - Required - A SimBEV object with simulation parameters. ### Returns - list of Trip - A list of Trip objects representing the car's trips. ``` ```APIDOC ## from_probability(region, car, time_step, simbev) ### Description Generates a single Trip object based on probability input data for a given car, region, and time step. ### Parameters #### Path Parameters - **region** (Region) - Required - A Region object representing the geographic area. - **car** (Car) - Required - A Car object for which to generate the trip. - **time_step** (int) - Required - The time step at which to start the trip. - **simbev** (SimBEV) - Required - A SimBEV object with simulation parameters. ### Returns - Trip - A Trip object representing the generated trip. ``` ```APIDOC ## get_max_parking_time(use_case) ### Description Determines the maximum allowed parking time for a trip given a specific charging use case. ### Parameters #### Path Parameters - **use_case** (str) - Required - The charging use case. ### Returns - int - The maximum parking time in time steps. ``` ```APIDOC ## park_time_until_threshold ### Description Returns the number of time steps between the start of parking and the next threshold. Returns 0 if the time is negative. ### Returns - int - Time steps until the threshold time on the same day. ``` -------------------------------- ### Pull Latest Changes Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Fetch the latest changes from the remote repository. ```bash git pull ``` -------------------------------- ### drive Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Simulates a driving event, returning whether the drive is possible. ```APIDOC ## drive ### Description Method for driving. ### Parameters #### Path Parameters - **distance** (*float*) – Distance of drive. - **start_time** (*int*) – Start time of drive. - **timestamp** (*Timestamp*) – Start time of drive. - **duration** (*int*) – Duration of drive in time - **destination** (*str*) – Location of destination. - **extra_urban** (*bool*) – Flag to determine if a drive is extra-urban (e.g. on a highway). ### Returns Returns if drive is possible. ### Return type bool ``` -------------------------------- ### Push Local Branch to Remote Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Push your local branch to the remote server 'origin'. Git will provide instructions if the branch does not yet exist on the remote. ```bash git push ``` -------------------------------- ### run_multi Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Runs the simulation using multiprocessing. This method is designed for parallel execution and may raise a SystemExit if an error occurs during multiprocessing. ```APIDOC ## run_multi() ### Description Runs Simulation for multiprocessing. ### Raises #### SystemExit If an Exception occurred during multiprocessing and the simulation stopped. ``` -------------------------------- ### simbev.plot.plot_gridtimeseries_by_usecase Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Creates grid timeseries plots, categorized by use case. This function is useful for visualizing energy consumption patterns across different scenarios. ```APIDOC ## simbev.plot.plot_gridtimeseries_by_usecase ### Description Create grid timeseries plots split by use case. ### Parameters * **simbev**: The SimBEV object containing simulation data. * **grid_timeseries_all**: A collection of all grid timeseries data to be plotted. ``` -------------------------------- ### Utility Function for Trip Creation Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md This section details the `create_trip_from_profile_row` function used to construct Trip objects from profile data. ```APIDOC ## simbev.trip.create_trip_from_profile_row(row, current_location, last_time_step, region, car, simbev, charging_use_case=None) ### Description Creates a Trip object using information from a driving profile row and other contextual data. This function calculates key trip attributes like start time, duration, destination, distance, and parking time. ### Parameters #### Path Parameters - **row** - Required - A data row from the profile containing trip information. - **current_location** - Required - The current location of the vehicle. - **last_time_step** (int) - Required - The time step of the vehicle's last action. - **region** (Region) - Required - The geographic region of the trip. - **car** (Car) - Required - The car object involved in the trip. - **simbev** (SimBEV) - Required - The simulation environment object. - **charging_use_case** (str) - Optional - The charging use case, if applicable. ### Returns - Trip - A Trip object representing the created trip. ### Notes - This function computes various trip attributes including drive start time, drive time, destination, distance, and parking time. - The `fit_trip_to_timerange()` method can be used to adjust the trip to fit within the simulation time range. - The `_set_timestamps()` method is used internally to set the trip's timestamps. ``` -------------------------------- ### export Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Exports simulation output values to a CSV file. ```APIDOC ## export ### Description Exports the output values collected in car object to .csv file. ### Parameters #### Path Parameters - **region_directory** (*pathlib.Path*) – save directory for the region - **simbev** (*SimBEV*) – SimBEV object with scenario information ### Returns Returns summarized information on charging- and driving-events. ### Return type ndarray ``` -------------------------------- ### park Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Represents a parking event for standing times without charging. ```APIDOC ## park ### Description Parking event, used for standing times without charging. ### Parameters #### Path Parameters - **trip** (*Trip*) – ``` -------------------------------- ### SimBEV Attributes Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Lists the attributes available for the SimBEV class, which store simulation data and configuration. ```APIDOC ### Attributes: * **region_data** - Data related to different regions for the simulation. * **charging_probabilities** - Charging probabilities data for BEVs. * **power_by_usecase** - Indicates whether power is calculated based on use cases. * **tech_data** - Technical data related to BEVs and PHEVs. * **energy_min** - Minimum charging energy. * **home_parking** - DataFrame representing probabilities of home parking for BEVs. * **work_parking** - DataFrame representing probabilities of work parking for BEVs. * **hpc_data** - Data related to high-power charging for BEVs. * **attractivity** - Attractivity data for user groups. * **charging_curve_points** - Charging curve points data. * **step_size** - Time step size for the simulation. * **soc_min** - Minimum state of charge (SOC) for BEVs. * **charging_threshold** - Charging threshold for BEVs. * **distance_threshold_extra_urban** - Distance threshold for extra-urban areas. * **threshold_retail_limitation** - Retail limitation threshold. * **threshold_retail_limitation_steps** - Time steps for the retail limitation threshold. * **threshold_street_limit** - Street night limitation threshold. * **threshold_street_limit_steps** - Time steps for the street night limitation threshold. * **fast_charge_threshold** - Fast charging threshold. * **consumption_factor_highway** - Consumption factor on highways. * **rng_seed** - Seed for the random number generator. * **eta_cp** - Charging efficiency. * **start_date_input** - Input start date for the simulation. * **start_date** - Start date for the simulation (adjusted by 7 days earlier). * **start_date_output** - Output start date for the simulation. * **end_date** - End date for the simulation. * **probability_detached_home** - Probability of detached home parking. * **private_only_run** - Flag indicating if EVs should try to be charged with only private charging infrastructure. * **street_night_charging_flag** - Flag indicating street night charging. * **home_night_charging_flag** - Flag indicating home night charging. * **night_departure_standard_deviation** - Standard deviation for night departure time. * **night_departure_time** - Night departure time. * **maximum_park_time_flag** - Flag indicating maximum park time. * **maximum_park_time** - Maximum park time in time steps. * **num_threads** - Number of threads used in the simulation. * **output_options** - List of output options. * **input_type** - Type of input data. * **input_directory** - Path to the input directory. * **input_data** - A dictionary containing input data for different regions. * **scaling** - Scaling factor for vehicle numbers. * **regions** - List of Region objects. * **created_region_types** - Dictionary of created region types. * **car_types** - Dictionary of car types. * **user_groups** - Dictionary of user groups. * **grid_data_list** - List of grid data. * **analysis_data_list** - List of analysis data. * **terminated** - Flag indicating if the simulation has terminated. * **charging_probability_warning_flag** - Flag indicating charging probability warning. * **name** - Name or identifier for this simulation. * **timestamp** - Timestamp indicating when the simulation was created. * **save_directory** - Path to the directory where simulation results are saved. * **file_name_all** - File name for grid time series data for all regions. * **file_name_analysis_all** - File name for analysis data for all regions. * **file_name_analysis_all_json** - File name for analysis data in JSON format for all regions. * **step_size_str** - Time step size as a string representation with ‘min’ suffix. ``` -------------------------------- ### timeitlog Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/simbev.helpers.md A timing decorator for functions that logs execution time. It can be enabled or disabled via a flag and saves results to a specified directory. ```APIDOC ## timeitlog(timing, save_directory) ### Description Timing decorator for functions. ### Parameters #### Path Parameters - **timing** (bool) - Required - Flag that indicates if decorated function should be timed or not. - **save_directory** (pathlib.Path) - Required - Path to the directory where simulation results are saved. ``` -------------------------------- ### SimBEV.hours_to_time_steps Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Converts a given time in hours to the corresponding number of time steps for the simulation. ```APIDOC #### hours_to_time_steps(t) ### Description Converts time in hours to timesteps. ### Parameters: * **t** (*float*) – Time in hours. ### Returns: Returns timesteps. ### Return type: int ``` -------------------------------- ### simbev.mid_timeseries.get_name_csv Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Produces the file name for seasonal data based on region and season. ```APIDOC ## simbev.mid_timeseries.get_name_csv(region, season, data_directory) Produces name of path for seasonal data. * **Parameters:** * **region** (*str*) – Current region. * **season** (*str*) – Season the data is wanted for. * **data_directory** (*pathlib.Path*) – Path to probability data directory * **Returns:** Path for the seasonal data in region. * **Return type:** WindowsPath ``` -------------------------------- ### Merge Release into Development Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Merge the release branch into the development branch. ```bash git merge release/vX.Y.Z ``` -------------------------------- ### Trip.create Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Finds the next driving event for a trip and sets the corresponding attributes. This method is part of the Trip class. ```APIDOC ## create: ### Description Finds next driving event and sets corresponding attributes. ``` -------------------------------- ### export_grid_timeseries_all_regions() Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Exports the grid-timeseries for all regions of the simulation. ```APIDOC #### export_grid_timeseries_all_regions() ### Description Export of grid-timeseries of all regions. ### Returns: Returns grid-timeseries for all regions. ### Return type: DataFrame ``` -------------------------------- ### simbev.mid_timeseries.get_profile_time_series Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Returns a time series filled with randomly chosen week data. ```APIDOC ## simbev.mid_timeseries.get_profile_time_series(start_date, end_date, step_size, df, seed) Returns a time series starting from the start date up until the end date filled with week data chosen at random from the input DataFrame for each week. * **Parameters:** * **start_date** (*str* *or* *datetime*) – The start date of the time series in yyyy-mm-dd format. * **end_date** (*str* *or* *datetime*) – The end date of the time series in yyyy-mm-dd format. * **step_size** (*int*) – Step size of the simulation in minutes. * **df** (*pd.DataFrame*) – The input DataFrame containing week data, where each entry with the same ID belongs to the same week. * **seed** (*int*) – Seed for the random number generator. * **Returns:** The resulting time series. * **Return type:** pandas DataFrame ``` -------------------------------- ### simbev.car.analyze_charge_events Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Analyzes charging events in the timeseries of one vehicle. ```APIDOC ## simbev.car.analyze_charge_events(output_df: DataFrame) Analyzes charging events in the timeseries of one vehicle. * **Parameters:** **output_df** (*Dataframe*) – Specific time series for given vehicle. * **Returns:** Returns information about charging events of vehicle in whole timeframe. * **Return type:** ndarray ``` -------------------------------- ### simulate_car Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Simulates the driving profiles for a specific car within a given region. It requires both the car and region objects as parameters. ```APIDOC ## simulate_car(car, region) ### Description Simulates driving profiles for a car. ### Parameters #### Path Parameters * **car** ([*Car*](#simbev.car.Car)) - Required - Includes all properties of current car. * **region** ([*Region*](#simbev.region.Region)) - Required - Includes all properties of current region. ``` -------------------------------- ### simbev.mid_timeseries.get_empty_timeseries Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Creates an empty DataFrame with a time index specified by the input parameters. ```APIDOC ## simbev.mid_timeseries.get_empty_timeseries(start_date, end_date, step_size) Creates an empty DataFrame with a time index specified by the input parameters. ``` -------------------------------- ### usable_soc Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Calculates the usable state of charge (SOC) of the vehicle's battery. ```APIDOC ## usable_soc ### Description Calculation of usable soc. ### Returns Returns soc that is usable. ### Return type float ``` -------------------------------- ### simbev.car.UserGroup Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Represents a user group with attributes for identification and attractivity values. ```APIDOC ## class simbev.car.UserGroup(user_group: int, attractivity: dict) Bases: `object` Represents a user group with attributes for identification and attractivity values. * **Parameters:** * **user_group** (*int*) – An integer representing the identification of the user group. * **attractivity** (*dict*) – A dictionary containing charging attractivity information for the user group. #### user_group An integer representing the identification of the user group. * **Type:** int #### attractivity A dictionary containing charging attractivity information for the user group. * **Type:** dict #### attractivity *: dict* #### user_group *: int* ``` -------------------------------- ### charging_curve Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Calculates the charging curve based on a 3rd-degree polynomial function, divided into sections fitted into time-steps. ```APIDOC ## charging_curve ### Description Implementation of charging curve. The charging-curve is based on a 3rd degree polynomial function. The charging-functions is sliced into 10 sections. These sections are fitted into the time-steps. ### Parameters #### Path Parameters - **trip** (*Trip*) – Includes information about current trip. - **power** (*float*) – Power of charging-point. - **step_size** (*int*) – Step-size of simulation. - **max_charging_time** (*int*) – Maximum possible time spend charging. - **charging_type** (*str*) – Type of charging (“fast” or “slow”) - **charging_use_case** (*str*) – Charging use case (relevant for end of charging calculation) - **soc_end** (*float*) – Soc-target of charging-event. ### Returns Returns charging parameters including charging-time, average power, power of charging-point and target-soc. ### Return type tuple[int,float,float,float] ``` -------------------------------- ### simbev.car.analyze_drive_events Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Analyzes driving events in the timeseries of one vehicle. ```APIDOC ## simbev.car.analyze_drive_events(output_df: DataFrame, car_type: str) Analyzes driving events in the timeseries of one vehicle. * **Parameters:** * **output_df** (*Dataframe*) – Specific time series for given vehicle. * **car_type** (*str*) – Type of vehicle. * **Returns:** Returns information about driving events of vehicle in whole timeframe. * **Return type:** ndarray ``` -------------------------------- ### SimBEV.get_charging_capacity Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Determines the charging capacity for a specific charging event based on location, use case, and distance. ```APIDOC #### get_charging_capacity(location=None, use_case=None, distance=None) ### Description Determines charging capacity for specific charging event ### Parameters: * **location** (*str*) – Current location of the vehicle. * **use_case** (*str*) – Charging use case. * **distance** (*float*) – Distance of trip. ### Returns: Returns charging capacity. ### Return type: Float ``` -------------------------------- ### export_metadata Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/simbev.helpers.md Exports metadata of a simulation run to a JSON file. This metadata is saved in the result's root directory. ```APIDOC ## export_metadata(simbev, config) ### Description Export metadata of run to JSON file in result’s root directory ### Parameters #### Path Parameters - **simbev** (SimBEV) - Required - SimBEV object with scenario information. - **config** (ConfigParser) - Required - Object for parsing config. ``` -------------------------------- ### simbev.mid_timeseries.get_season Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Determines the season for a given date. ```APIDOC ## simbev.mid_timeseries.get_season(date: date) Determines season. * **Parameters:** **date** (*date*) – Date request. * **Returns:** **season** – Season of the date. * **Return type:** str ``` -------------------------------- ### CarType Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Represents different car types with their specific attributes like battery capacity, charging capabilities, and consumption. ```APIDOC ### *class* simbev.car.CarType(name: str, battery_capacity: float, charging_capacity: dict, soc_min: float, charging_threshold: float, energy_min: dict, charging_curve: interp1d, consumption: float, consumption_factor_highway: float, output: bool, attractivity: DataFrame, analyze_mid: bool = False, label: str | None = None) Bases: `object` Object that describes car-types. #### name Type and class of vehicle. * **Type:** str #### battery_capacity Capacity of battery. * **Type:** float #### charging_capacity maximum charging-power of vehicle. * **Type:** dict #### soc_min Minimum soc that is allowed. * **Type:** soc_min #### charging_threshold Soc threshold for tripping a charging event. * **Type:** float #### energy_min Minimum energy for charging events by use case. * **Type:** dict #### charging_curve curve that describes charging-power dependent of soc. * **Type:** dict #### consumption consumption of car. * **Type:** float #### consumption_factor_highway Influence on the consumption of a vehicle by driving on the highway. * **Type:** float #### output Setting for output. * **Type:** bool #### attractivity * **Type:** pd.DataFrame #### analyze_mid Setting for analysis-output * **Type:** bool #### label Drive type of vehicle. * **Type:** str #### analyze_mid *: bool* *= False* #### attractivity *: DataFrame* #### battery_capacity *: float* #### charging_capacity *: dict* #### charging_curve *: interp1d* #### charging_threshold *: float* #### consumption *: float* #### consumption_factor_highway *: float* #### energy_min *: dict* #### label *: str* *= None* #### name *: str* #### output *: bool* #### soc_min *: float* ``` -------------------------------- ### remaining_range Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Provides the current remaining range of the vehicle. ```APIDOC ## remaining_range ### Description Returns remaining range of vehicle. ``` -------------------------------- ### set_user_group Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Determines the user group based on the available private charging infrastructure. It considers work parking, home parking, work capacity, and home capacity. ```APIDOC ## set_user_group(work_parking, home_parking, work_capacity, home_capacity) ### Description Decides on a user group based on private charging infrastructure available. ### Parameters #### Path Parameters * **work_parking** (type) - Required - Description * **home_parking** (type) - Required - Description * **work_capacity** (type) - Required - Description * **home_capacity** (type) - Required - Description ``` -------------------------------- ### export_analysis Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/simbev.helpers.md Generates CSV and JSON files for the analysis of simulation output. This function is used to save simulation results in a structured format. ```APIDOC ## export_analysis(analysis_array, directory, start_date, end_date, region_id) ### Description Generates csv and json file for analysis of simulation-output. ### Parameters #### Path Parameters - **analysis_array** (ndarray) - Required - Contains Data for analysis of characteristic values. - **directory** (WindowsPath) - Required - Directory for saving files. - **start_date** (datetime) - Required - Start of simulation. - **end_date** (date) - Required - End of simulation. - **region_id** (str) - Required - Identifier of region. ``` -------------------------------- ### SimBEV.get_rng Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Creates a Random Number Generator (RNG) based on the provided RNG seed. ```APIDOC #### get_rng() ### Description Create RNG based on the given rng seed. ``` -------------------------------- ### simbev.car.Car Class Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Represents a vehicle in the SimBEV simulation. It holds all information and methods related to a specific vehicle, including its type, user group, charging capabilities, and current status. ```APIDOC ## simbev.car.Car Class ### Description Represents a vehicle. Contains all information and methods of that vehicle. ### Class Signature ```python Car(car_type: CarType, user_group: UserGroup, number: int, work_parking, home_parking, work_capacity, home_capacity, region, home_detached, soc: float = 1.0, status: str = 'home', private_only=False, fast_charging_threshold=50) ``` ### Parameters * **car_type** (CarType) – Includes all information regarding the vehicle. * **user_group** (UserGroup) – Specification of the user-group the vehicle belongs to. * **number** (int) – Number of the vehicle. * **work_parking** (bool) – Identifier for private parking at work. * **home_parking** (bool) – Identifier for private parking at home. * **work_capacity** (float) – Power of LIS at work. * **home_capacity** (float) – Power of LIS at home. * **region** (Region) – Includes data related to current region. * **home_detached** (bool) – Identifier for private parking at home. * **soc** (float, optional) – Soc of car. Defaults to 1.0. * **status** (str, optional) – Location of car. Defaults to 'home'. * **private_only** (bool, optional) – Defaults to False. * **fast_charging_threshold** (int, optional) – Defaults to 50. ### Attributes * **car_type** (CarType) – Includes all information regarding the vehicle. * **file_name** (str) – Name of the csv-file that contains. * **home_capacity** (float) – Power of charging-point at work. * **home_parking** (bool) – Identifier if there is private-parking at home. * **hpc_data** (dict) – Configuration-data for hpc charging. * **hpc_pref** (float) – Value of attraction for hpc of vehicle. * **number** (int) – Number of the vehicle. * **output** (dict) – Timeseries of vehicle that contains output-data for every event of vehicle. * **region** (Region) – Includes data related to current region. * **remaining_range** (float) – Remaining range of vehicle. * **soc** (float) – Soc of vehicle. * **soc_start** (float) – Soc at start of event. * **status** (str) – Location of car. * **usable_soc** (float) – Soc that is usable for the next drive. * **user_spec** (str) – Specification of the user-group the vehicle belongs to. * **work_parking** (bool) – Identifier for private parking at work. * **work_capacity** (float) – Power of charging-point at work. ### Methods #### charge(trip, power, charging_type, charging_use_case, step_size=None, max_charging_time=None) Function for charging. * **Parameters:** * **trip** (Trip) – Includes information about trip. * **power** (float) – Power of charging-point. * **charging_type** (str) – Type of charging (slow or fast). * **charging_use_case** (str) – Charging use case of charging event. * **step_size** (int, optional) – Step-size of simulation. * **max_charging_time** (int, optional) – Maximum possible time spend charging. #### charge_home(trip) Function for initiation of charging-event in use-case home. * **Parameters:** **trip** (Trip) – Includes information about current trip. #### charge_public(trip, station_capacity, max_parking_time, use_case) Function for initiation of charging-event in public use cases. * **Parameters:** * **trip** (Trip) – Includes information about current trip. * **station_capacity** (float) – Charging power of charging infrastructure in kW. * **max_parking_time** (int) – Maximum possible parking time in timesteps. * **use_case** (str) – Charging use case. #### charge_work(trip) Function for initiation of charging-event in use-case work. * **Parameters:** **trip** (Trip) – Includes information about current trip. ``` -------------------------------- ### simbev.region.Region Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Represents a geographical region within the simulation, holding data and methods related to that region's characteristics and simulation results. ```APIDOC ## class simbev.region.Region ### Description Class that contains information and methods related to the region. ### Parameters * **region_id** (*str*): Identifier for region-type. * **region_type** (*RegionType*): Object of class RegionType. * **region_counter** (*int*): Number of region. * **car_dict** (*dict*): Distribution of cars in region. ### Attributes * **analyze_array** (*ndarray*): Array that contains values of analysis. * **car_amount** (*int*): Amount of cars in region. * **car_dict** (*dict*): Distribution of car-types. * **file_name** (*str*): Name of csv-file for grid timeseries of specific region. * **grid_data_frame** (*list*): Summarized time-series for whole region. * **grid_time_series** (*ndarray*): Summarized time-series for whole region. * **header_grid_ts** (*list*): Header of grid-time-series. * **id** (*str*): Identifier of region. * **last_time_step** (*int*): Last time-step of simulation. * **number** (*int*): Counter of regions simulated. * **region_type** (*RegionType*): Object of class RegionType. ### Properties * **car_amount** (*int*): Returns number of vehicles. ### Methods #### analyze_array() #### car_amount() #### car_dict() #### create_grid_timeseries() Constructs grid-time-series. #### export_grid_timeseries(region_directory) Exports the grid time series to a .csv file. * **Parameters**: * **region_directory** (*WindowsPath*): Save-directory for the region. #### file_name() #### get_probability(rng, destination, key) Gets properties for trip in use of probabilities. * **Parameters**: * **rng** (*Generator*): Random number generator. * **destination** (*str*): Destination of trip. * **key** (*str*): Key for probability. * **Returns**: probability for parameter. * **Return type**: float * **Raises**: **ValueError**: If destination is hpc. #### get_purpose(rng, time_step) Determinants purpose of trip. * **Parameters**: * **rng** (*Generator*): Random number generator. * **time_step** (*int*): Time-step of simulation. * **Returns**: Destination of trip. * **Return type**: str #### grid_data_frame() #### grid_time_series() #### header_grid_ts() #### id() #### last_time_step() #### number() #### region_type() #### update_grid_timeseries(use_case, chargepower, power_lis, timestep_start, timestep_end, i, park_ts_end, car_type) Writes values in grid-time-series. * **Parameters**: * **use_case** (*str*): Use-case of event. * **chargepower** (*float*): Average power of charging-event. * **power_lis** (*float*): Maximum power of charging-point. * **timestep_start** (*int*): Start of event. * **timestep_end** (*int*): End of event. * **i** (*int*): Counter for steps in charging curve. * **park_ts_end** (*int*): End of parking-time. * **car_type** (*str*): Type of car (BEV/PHEV and Segment). ``` -------------------------------- ### date_string_to_datetime Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/simbev.helpers.md Converts a date string into a datetime object. This is useful for standardizing date inputs. ```APIDOC ## date_string_to_datetime(date_str) ### Description Function that converts string to date-format. ### Parameters #### Path Parameters - **date_str** (str) - Required - Date to be converted. ### Returns Converted date. ### Return type date ``` -------------------------------- ### simbev.region.RegionType Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Defines the characteristics and types of a region, including simulation parameters and probabilities. ```APIDOC ## class simbev.region.RegionType ### Description Constructor for class RegionType. ### Parameters * **rs7_type** (*str*): Type of the region defined by RegioStaR7. * **grid_output** (*bool*): Identifier if grid output is activated. * **step_size** (*int*): Step-size of simulation. * **charging_probabilities** (*dict*): Probabilities for power of charging-point. ### Attributes * **charging_probabilities** (*dict*): Probabilities for power of charging-point. * **output** (*bool*): Identifier if grid output is activated. * **probabilities** (*dict*): Probabilities related to trip that are dependent on region-type. * **rs7_type** (*int*): Type of the region defined by RegioStaR7. * **step_size** (*int*): Step-size of simulation. * **time_series** (*DataFrame*): Timeseries of processed MiD-data, that includes amount of trips started by destination and datetime. * **trip_starts** (*Series*): Probabilities for start of a trip by datetime. ### Methods #### create_timeseries(simbev) Creating timeseries for vehicle. * **Parameters**: * **simbev** (*SimBEV object*): Used attributes are start_date, end_date, step_size and the input_directory. #### get_probabilities(data_directory) Unites probabilities for trip. * **Parameters**: * **data_directory** (*WindowsPath*): Directory of input-data. ``` -------------------------------- ### precise_remaining_range Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Calculates the precise remaining range of the vehicle. ```APIDOC ## precise_remaining_range ### Description Calculation of precise remaining range of vehicle. ### Returns Returns remaining range of vehicle. ### Return type float ``` -------------------------------- ### get_column_by_random_number Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/simbev.helpers.md Selects a column name from a DataFrame based on a random number and a series of probabilities. This is useful for probabilistic simulations. ```APIDOC ## get_column_by_random_number(probability_series, random_number) ### Description Takes a random number and a pandas.DataFrame with one row that contains probabilities, returns a column name. ### Parameters #### Path Parameters - **probability_series** (Series) - Required - Contains probabilities for charging power. - **random_number** (float) - Required - Random number. ### Returns A column name. ### Return type str ``` -------------------------------- ### remaining_range_highway Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Provides the current remaining range of the vehicle, specifically for highway driving. ```APIDOC ## remaining_range_highway ### Description Returns remaining range of vehicle. ``` -------------------------------- ### Amend Latest Commit Message Source: https://github.com/rl-institut/simbev/blob/dev/CONTRIBUTING.md Use this command to edit the commit message of your latest commit, provided it has not been pushed. It also allows for adding or modifying changes within that commit. ```bash git commit --amend ``` -------------------------------- ### precise_remaining_range_highway Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/features.md Calculates the precise remaining range of the vehicle, specifically for highway driving. ```APIDOC ## precise_remaining_range_highway ### Description Calculation of precise remaining range of vehicle. ### Returns Returns remaining range of vehicle. ### Return type float ``` -------------------------------- ### interpolate_charging_curve Source: https://github.com/rl-institut/simbev/blob/dev/docs/source/simbev.helpers.md Performs cubic interpolation between two arrays of data points. This function is a wrapper for scipys interp1d function. ```APIDOC ## interpolate_charging_curve(x, y) ### Description Cubic interpolation between x and y. Wrapper for scipys interp1d function. ### Parameters #### Path Parameters - **x** (array_like) - Required - - **y** (array_like) - Required - ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.