Skip to content

Commit e12f8ec

Browse files
committed
[nb/results] Add RL results
1 parent 4ffef8d commit e12f8ec

File tree

7 files changed

+984
-378
lines changed

7 files changed

+984
-378
lines changed

notebooks/07-Results.ipynb

+89-66
Large diffs are not rendered by default.

notebooks/07-Results.py

+25-18
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# ## Imports and Data loading
88

9-
# In[3]:
9+
# In[1]:
1010

1111

1212
# Display plots inline
@@ -17,7 +17,7 @@
1717
get_ipython().run_line_magic('autoreload', '2')
1818

1919

20-
# In[13]:
20+
# In[2]:
2121

2222

2323
from datetime import datetime
@@ -29,7 +29,7 @@
2929
from evsim.data import load
3030

3131

32-
# In[14]:
32+
# In[3]:
3333

3434

3535
pd.set_option('display.float_format', '{:.4f}'.format)
@@ -47,7 +47,7 @@ def read_results(path):
4747

4848
# ## Regular Profit
4949

50-
# In[15]:
50+
# In[4]:
5151

5252

5353
df_car2go = pd.read_pickle("../data/processed/trips_big.pkl")
@@ -59,7 +59,7 @@ def read_results(path):
5959

6060
# ## Charging Stations
6161

62-
# In[17]:
62+
# In[5]:
6363

6464

6565
df_c = df_car2go.loc[df_car2go["end_charging"] == 1, ["end_lat", "end_lon"]].round(3)
@@ -69,7 +69,7 @@ def read_results(path):
6969

7070
# # Baseline Charging
7171

72-
# In[11]:
72+
# In[6]:
7373

7474

7575
df = read_results("../results/baseline.csv")
@@ -80,7 +80,7 @@ def read_results(path):
8080

8181
# ## Benchmark
8282

83-
# In[4]:
83+
# In[7]:
8484

8585

8686
df_i = read_results("../results/intraday-benchmark.csv")
@@ -89,7 +89,7 @@ def read_results(path):
8989

9090
# ## Risk Averse (r=0.3, acc=90)
9191

92-
# In[5]:
92+
# In[8]:
9393

9494

9595
df_i = read_results("../results/intraday-risk-averse.csv")
@@ -100,7 +100,7 @@ def read_results(path):
100100

101101
# ## Benchmark
102102

103-
# In[6]:
103+
# In[9]:
104104

105105

106106
df_b = read_results("../results/balancing-benchmark.csv")
@@ -109,7 +109,7 @@ def read_results(path):
109109

110110
# ## Risk Averse (r=0.5, acc=70)
111111

112-
# In[7]:
112+
# In[10]:
113113

114114

115115
df_b = read_results("../results/balancing-risk-averse.csv")
@@ -118,25 +118,32 @@ def read_results(path):
118118

119119
# # Integrated
120120

121-
# In[21]:
121+
# In[33]:
122122

123123

124124
df_in = read_results("../results/integrated-benchmark-acc-1.csv")
125125
df_in.sum()/1000
126126

127127

128+
# In[43]:
129+
130+
131+
df_in = read_results("../results/integrated-rl-1.csv")
132+
df_in.sum()/1000
133+
134+
128135
# ## Risk Averse (r=0.5,0.3, acc=70,90)
129136

130-
# In[20]:
137+
# In[17]:
131138

132139

133140
df_in = read_results("../results/integrated-risk-averse.csv")
134-
df_in.sum()/1000
141+
len(df_in)
135142

136143

137144
# ## Risk Seeking (r=0.2,0.00, acc=70,90)
138145

139-
# In[9]:
146+
# In[32]:
140147

141148

142149
df_in = read_results("../results/integrated-risk-seeking.csv")
@@ -147,7 +154,7 @@ def read_results(path):
147154

148155
# ## Style
149156

150-
# In[9]:
157+
# In[14]:
151158

152159

153160
sns.set(rc={'figure.figsize':(10,6)})
@@ -166,7 +173,7 @@ def read_results(path):
166173

167174
# ## Fleet Utilization
168175

169-
# In[10]:
176+
# In[42]:
170177

171178

172179
df_stats = read_results("../results/stats-baseline.csv")
@@ -181,11 +188,11 @@ def labels(y):
181188

182189
Y = ["available_evs", "charging_evs", "vpp_evs"]
183190
for y in Y:
184-
ax = sns.lineplot(x="hour", y=y, ci="sd", data=df_stats, label=labels(y))
191+
ax = sns.lineplot(x="hour", y=y, ci="sd", markers=['X'], data=df_stats, label=labels(y))
185192

186193
sns.despine(offset=10)
187194
ax.set(xlabel='Hour', ylabel='Number EVs')
188-
plt.xticks(np.arange(0, 24, 2));
195+
plt.xticks(np.arange(0, 24, 2), rotation=90);
189196
plt.yticks(np.arange(0, 500, 50));
190197
plt.savefig("../results/fig/fleet-utilization.png")
191198

0 commit comments

Comments
 (0)