-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f26953a
commit 3da5ce4
Showing
11 changed files
with
391 additions
and
113 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
ProcessingForPaper/1_calculate_driver_feature_vectors.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\"\"\"\n", | ||
"SPEECh: Scalable Probabilistic Estimates of EV Charging\n", | ||
"\n", | ||
"Code first published in October 2021.\n", | ||
"\n", | ||
"Developed by Siobhan Powell ([email protected]).\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\"\"\"\n", | ||
"SPEECh: Scalable Probabilistic Estimates of EV Charging\n", | ||
"\n", | ||
"Code first published in October 2021.\n", | ||
"\n", | ||
"Developed by Siobhan Powell ([email protected]).\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\"\"\"\n", | ||
"SPEECh: Scalable Probabilistic Estimates of EV Charging\n", | ||
"\n", | ||
"Code first published in October 2021.\n", | ||
"\n", | ||
"Developed by Siobhan Powell ([email protected]).\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\"\"\"\n", | ||
"SPEECh: Scalable Probabilistic Estimates of EV Charging\n", | ||
"\n", | ||
"Code first published in October 2021.\n", | ||
"\n", | ||
"Developed by Siobhan Powell ([email protected]).\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
@@ -280,25 +293,6 @@ | |
" return end_times, load" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 14, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# # 1, 2 is good, 6 is good, 10 is good, 13 is good\n", | ||
"# drivers = key_driver_info[key_driver_info['Dend Cluster Number']==15]['Unique Driver ID'].values\n", | ||
"# subset = df[df['Driver ID'].isin(drivers)]\n", | ||
"\n", | ||
"# print(np.unique(subset[subset['start_day']==51]['Driver ID']).shape)\n", | ||
"# print(subset[subset['start_day']==51]['start_datetime'].values[0])\n", | ||
"# print(subset[subset['start_day']==51]['start_weekday'].values[0])\n", | ||
"# print(len(drivers))\n", | ||
"# all_loads = raw_data_load(subset[subset['start_day']==51])\n", | ||
"# # total_all_loads = raw_data_load(df.loc[(df['start_day']==51)&(df['Driver ID'].isin(key_driver_info['Unique Driver ID'].values))])\n", | ||
"# plotting(all_loads, set_ymax=40, locs=np.arange(0, 40, 10))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\"\"\"\n", | ||
"SPEECh: Scalable Probabilistic Estimates of EV Charging\n", | ||
"\n", | ||
"Code first published in October 2021.\n", | ||
"\n", | ||
"Developed by Siobhan Powell ([email protected]).\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\"\"\"\n", | ||
"SPEECh: Scalable Probabilistic Estimates of EV Charging\n", | ||
"\n", | ||
"Code first published in October 2021.\n", | ||
"\n", | ||
"Developed by Siobhan Powell ([email protected]).\n", | ||
"\"\"\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
|
@@ -540,98 +553,13 @@ | |
" results.to_csv('ProcessingForPaper/time_results.csv')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# total_evs = 1e9\n", | ||
"\n", | ||
"# tic = time.time()\n", | ||
"# model = SPEECh(data)\n", | ||
"# config = SPEEChGeneralConfiguration(model)\n", | ||
"# new_weights_pg = dict(zip(counts_df['AC Cluster Number'], counts_df['Scen1']))\n", | ||
"# config.change_pg(new_weights=new_weights_pg)\n", | ||
"# config.num_evs(total_evs)\n", | ||
"# config.groups()\n", | ||
"# config.change_ps_zg(data.cluster_reorder_dendtoac[3], 'Home', 'weekday', base_weights3)\n", | ||
"# config.change_ps_zg(data.cluster_reorder_dendtoac[4], 'Home', 'weekday', base_weights4)\n", | ||
"# config.change_ps_zg(data.cluster_reorder_dendtoac[5], 'Home', 'weekday', base_weights5)\n", | ||
"# config.run_all(weekday=weekday_option)\n", | ||
"# toc = time.time()\n", | ||
"# print(toc-tic)\n", | ||
"# results.loc[i+1, 'Time'] = toc-tic\n", | ||
"# results.loc[i+1, 'Number of EVs'] = total_evs\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plot results: " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"104.78948941628138" | ||
] | ||
}, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"(toc-tic)/60" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 15, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"9.860000000000001" | ||
] | ||
}, | ||
"execution_count": 15, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"591.6/60" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 16, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"49.43333333333333" | ||
] | ||
}, | ||
"execution_count": 16, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"2966/60" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
""" | ||
SPEECh: Scalable Probabilistic Estimates of EV Charging | ||
Code first published in October 2021. | ||
Developed by Siobhan Powell ([email protected]). | ||
This script runs the scenarios and generates the plots shown in the Results Section of the paper | ||
`Scalable Probabilistic Estimates of Electric Vehicle Charging Given Observed Driver Behavior'. | ||
""" | ||
|
||
import pandas as pd | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
"""Demonstrate built-in plotting options. Make sure to close each figure after it opens to continue the script.""" | ||
""" | ||
SPEECh: Scalable Probabilistic Estimates of EV Charging | ||
Code first published in October 2021. | ||
Developed by Siobhan Powell ([email protected]). | ||
This script demonstrates running the model, simple changes to behavioural component weights, and the use of built-in plotting options. | ||
Make sure to close each figure after it opens to continue the script. | ||
""" | ||
|
||
from speech import DataSetConfigurations | ||
from speech import SPEECh | ||
|
@@ -13,11 +20,11 @@ | |
data = DataSetConfigurations('Original16', ng=16) | ||
model = SPEECh(data) | ||
config = SPEEChGeneralConfiguration(model) | ||
plots = Plotting(model, n=total_evs) # plots total_evs (1000) in each group (i.e. ignores P(G)) | ||
plots = Plotting(model, n=total_evs) # plots total_evs | ||
plots.total(weekday='weekday', save_str='simple_example_plot.png') | ||
plots.pg() | ||
plots.sessions_components(g=1, cat='Work', weekday='weekday') | ||
plots.groups(save_string='simple_example_groups.png') | ||
plots.groups(save_string='simple_example_groups.png', n=total_evs) # plots total_evs in each group | ||
|
||
# Demonstration of changing group weights and behaviour weights: | ||
model = SPEECh(data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters