<jupyter_start><jupyter_text>>>  MaaSSim tutorial  quickstart<jupyter_code>import os, sys # add MaaSSim to path (not needed if MaaSSim is already in path)
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>prepare<jupyter_code>from MaaSSim.utils import get_config, load_G, prep_supply_and_demand  # simulator
from MaaSSim.data_structures import structures as inData
from MaaSSim.simulators import simulate
params = get_config('../../data/config/default.json')  # load configuration
params.nP = 2  # parameterize supply 
params.nV = 1  # and demand
inData = load_G(inData, params)  # load network graph 
inData = prep_supply_and_demand(inData, params)  # generate supply and demand<jupyter_output><empty_output><jupyter_text>simulate<jupyter_code>sim = simulate(params = params, inData = inData) # simulate<jupyter_output>27-10-20 11:49:43-WARNING-Setting up 1h simulation at 2020-10-27 11:33:06 for 1 vehicles and 2 passengers in Nootdorp, Netherlands
27-10-20 11:49:43-INFO--------------------	Starting simulation	-------------------
27-10-20 11:49:43-INFO-pax    0  got to dest at                           2020-10-27 11:40:40
27-10-20 11:49:43-INFO-pax    1  got to dest at                           2020-10-27 11:52:07
27-10-20 11:49:43-INFO-veh    1  quitted shift                            2020-10-27 14:33:05
27-10-20 11:49:43-INFO--------------------	Simulation over		-------------------
27-10-20 11:49:43-INFO-queue of requests 0
27-10-20 11:49:43-WARNING-simulation time 0.1 s
27-10-20 11:49:43-WARNING-assertion tests for simulation results - passed<jupyter_text>walkthrough demand structure<jupyter_code>inData.requests.head(2)
inData.vehicles.head(2)
inData.passengers.head(2)<jupyter_output><empty_output><jupyter_text>visualize the demand<jupyter_code>#import matplotlib.pyplot as plt
#inData.requests['dist'] = [inData.skim[request.origin]
#                           [request.destination] for _, request in inData.requests.iterrows()]     
from MaaSSim.visualizations import plot_demand
plot_demand(inData, vehicles = True, s = 10, params = params)<jupyter_output><empty_output><jupyter_text>results (raw)<jupyter_code>list(sim.runs.keys()) #consecutive runs
list(sim.runs[0].keys()) # single run results<jupyter_output><empty_output><jupyter_text>passengers raw results<jupyter_code>sim.runs[0].trips.head(10) #trip segment reports<jupyter_output><empty_output><jupyter_text>vehicles raw results<jupyter_code>df = sim.runs[0].rides
df[df.veh == 1]<jupyter_output><empty_output><jupyter_text>visualization<jupyter_code>df = sim.runs[0].trips
df = df[df.pax == 1]
df
from MaaSSim.visualizations import plot_veh
df = sim.runs[0].rides
plot_veh(inData.G, df[df.veh ==1])<jupyter_output><empty_output><jupyter_text>results processed<jupyter_code>sim.output() # call to generate reports
list(sim.res[0].keys())
sim.res[0].pax_kpi
sim.res[0].veh_kpi.T.head(1)
sim.res[0].veh_exp
sim.res[0].pax_exp.tail()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14496073298429318, 'fraction_numerical': 0.06413612565445026, 'mean_word_length': 4.353765323992994, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 42, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '348554', 'license': 'MIT', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1107, 'n_words': 206, 'path': 'docs/tutorials/01_Quickstart.ipynb', 'repo_name': 'ABedychaj/MaaSSim', 'size': '3056'}