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>
Hint
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
│ ├── Step1Mobility.py
│ ├── Step2DrivingConsumption.py
│ ├── Step3GridAvailability.py
│ ├── Step4GridDemand.py
│ ├── 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 |
Description |
---|---|
|
Mobility data files that can be changed in this folder. |
|
Uses |
|
Uses |
|
Uses |
|
Uses |
|
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.
Warning
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 Step1Mobility.py
$ python Step2DrivingConsumption.py
$ python Step3GridAvailability.py
$ python Step4GridDemand.py
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