<jupyter_start><jupyter_text>Create charging eventsCharging Events in Elvis can be generated from distributions or from other charging event data.  Import the moduleMake the modules available for the Notebook<jupyter_code>import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
    sys.path.append(module_path)<jupyter_output><empty_output><jupyter_text>From distributions Independent distributionsCreate charging events from arrival time, parking time, SOC distributions which are independent.Note: * Currently only hourly data for one week is supported.* Parking time, arrival SOC, target SOC and vehicle type are all fixed<jupyter_code>import random
hours_per_week = 7 * 24
arrival_distribution =[] 
for i in range(hours_per_week):
    arrival_distribution.append(random.random())<jupyter_output><empty_output><jupyter_text>In order to generate data from a weekly arrival distribution we need 3 parameters:* the above initialised probability distribution as a list* the amount of charging events per week* All time steps of the simulation period as a list<jupyter_code>import elvis.charging_event_generator as ceg
from elvis.utility.elvis_general import create_time_steps
from elvis.vehicle import ElectricVehicle
from elvis.battery import EVBattery
import datetime
# generate the time parameters
start_date = datetime.datetime(year=2020, month=1, day=1)
end_date = datetime.datetime(year=2020, month=1, day=10)
resolution = datetime.timedelta(minutes=15) # time in between two adjacent time steps

time_stamps = create_time_steps(start_date, end_date, resolution)
mean_park = 5
std_deviation_park = 2
mean_soc = 0.7
std_deviation_soc = 0.1
kwargs = {'brand': 'VW', 'model': 'e-Golf', 'probability': 1, 'battery': {'capacity': 35.8,
              'min_charge_power': 0, 'max_charge_power': 150, 'efficiency': 1}}
vehicle_types = [ElectricVehicle.from_dict(**kwargs)]

num_weekly_charging_events = 10 # Since we simulate 10 days we assume #events = 10 days / 7 days * 10 cars per week 
charging_events = ceg.create_charging_events_from_weekly_distribution(
    arrival_distribution, time_stamps, num_weekly_charging_events,
    mean_park, std_deviation_park, mean_soc, std_deviation_soc, vehicle_types)
for charging_event in charging_events:
    print(charging_event, '\n')<jupyter_output>Charging event: 1, Arrival time: 2020-01-01 02:00:00, Parking_time: 5, Leaving_time: 2020-01-01 07:00:00, SOC: 0.8, SOC target: 1.0, Connected car: Brand: Aston Martin, model: Vantage V12 Roadster 

Charging event: 2, Arrival time: 2020-01-01 13:15:00, Parking_time: 5, Leaving_time: 2020-01-01 18:15:00, SOC: 0.8, SOC target: 1.0, Connected car: Brand: Aston Martin, model: Vantage V12 Roadster 

Charging event: 3, Arrival time: 2020-01-01 19:00:00, Parking_time: 5, Leaving_time: 2020-01-02 00:00:00, SOC: 0.8, SOC target: 1.0, Connected car: Brand: Aston Martin, model: Vantage V12 Roadster 

Charging event: 4, Arrival time: 2020-01-02 11:15:00, Parking_time: 5, Leaving_time: 2020-01-02 16:15:00, SOC: 0.8, SOC target: 1.0, Connected car: Brand: Aston Martin, model: Vantage V12 Roadster 

Charging event: 5, Arrival time: 2020-01-02 15:30:00, Parking_time: 5, Leaving_time: 2020-01-02 20:30:00, SOC: 0.8, SOC target: 1.0, Connected car: Brand: <NAME>, model: Vantage V12 Roadster 

Charg[...]
{'fraction_non_alphanumeric': 0.09649385675756668, 'fraction_numerical': 0.06682649086005395, 'mean_word_length': 5.854209445585216, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '612751', 'license': 'MIT', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1086, 'n_words': 352, 'path': 'examples/create_charging_events.ipynb', 'repo_name': 'dailab/elvis', 'size': '3343'}