Base Case

This is the base case that will be created if no specific template is selected. It serves as a foundation for own modeling and to get an overview for the program.

To initialize the base case and create a project folder, no template needs to be specified:

$ emobpy create -n <give a name>


Before running this example, install and activate a dedicated environment (a conda environment is recommended).

The initialisation creates a folder and file structure as follows:

├── my_evs
│   └── config_files
│       ├── DepartureDestinationTrip.csv
│       ├── DistanceDurationTrip.csv
│       ├── TripsPerDay.csv
│       ├── rules.yml
│   ├── Time-series_generation.ipynb
│   ├──
│   ├──
│   ├──
│   ├──
│   ├── Visualize_and_Export.ipynb

This base case consists of four .py files that run the modelling, a .ipynb to visualise the results and the config_files folder that contains mobility data.

File name



Mobility data files that can be changed in this folder.

Uses emobpy.Mobility() to create individual mobility time series with vehicle location and distance travelled.

Uses emobpy.Consumption() to assign vehicles and to model their consumption.

Uses emobpy.Availability() to create the grid availability time series.

Uses emobpy.Charging() to calculate the grid electricity demand time series.


Jupyter Notebook File to view the results. See Visualization.


Jupyter Notebook File to create and visualize all four time series (Recomended).

After initialisation, you have two options: Using jupyter notebook or the python interpreter directly.

Method 1: Using Jupyter notebook

$ jupyter notebook

It will open the notebook in your browser. The document contains all instructions.


Make sure you have installed jupyter in your activated environment. To install it type in the console conda install jupyter

The jupyter notebook file could look like this, for example: Open file in a new tab

Method 2: Python interpreter

Run the script in the following order:

$ cd <given name>
$ python
$ python
$ python
$ python

The results are saved as pickle files. To read them, two methods can be implemented. Using the DataBase class as described in the Visualize_and_Export.ipynb or by opening the pickle file directly. More information can be found in the pickle documentation.

The pickle file can be opened as follows:

pickle_in = open("data.pickle","rb")
data = pickle.load(pickle_in)

The jupyter notebook file .ipynb file could look like this: Open file in a new tab