diff --git a/Database_Connector b/Database_Connector
index 3edd3306b01c6f278b89cd6a5564eed1dab6b905..6af063568b121ae3a6d224dcc1e27034f7ecbfe4 160000
--- a/Database_Connector
+++ b/Database_Connector
@@ -1 +1 @@
-Subproject commit 3edd3306b01c6f278b89cd6a5564eed1dab6b905
+Subproject commit 6af063568b121ae3a6d224dcc1e27034f7ecbfe4
diff --git a/GUI b/GUI
index 3584559e580a898c968d5f030d422478d84ee0d3..38e84d6b9223a4badf57c20a6752124b31bb3ed7 160000
--- a/GUI
+++ b/GUI
@@ -1 +1 @@
-Subproject commit 3584559e580a898c968d5f030d422478d84ee0d3
+Subproject commit 38e84d6b9223a4badf57c20a6752124b31bb3ed7
diff --git a/Model_Library b/Model_Library
index 4fb0477cfaee77e4ddc1e4d4afc8c59e1d3ace56..2562cac5ba7b6280539585cb0496dcd7b0ffdda0 160000
--- a/Model_Library
+++ b/Model_Library
@@ -1 +1 @@
-Subproject commit 4fb0477cfaee77e4ddc1e4d4afc8c59e1d3ace56
+Subproject commit 2562cac5ba7b6280539585cb0496dcd7b0ffdda0
diff --git a/Tooling b/Tooling
index 97869b2321320c33800980122b4537fe5dae816a..9876be800f7813c0f97473c69cb6563d25600afd 160000
--- a/Tooling
+++ b/Tooling
@@ -1 +1 @@
-Subproject commit 97869b2321320c33800980122b4537fe5dae816a
+Subproject commit 9876be800f7813c0f97473c69cb6563d25600afd
diff --git a/input_files/data/prices/day-ahead/hourly_price.csv b/input_files/data/prices/day-ahead/hourly_price.csv
index 324ccc91941ee69291fb7a1bea548169ab5e614f..b2882c62aeb7660a9d9c28eae1b9dadb55f9157e 100644
--- a/input_files/data/prices/day-ahead/hourly_price.csv
+++ b/input_files/data/prices/day-ahead/hourly_price.csv
@@ -6,7 +6,7 @@ timestamp,day_ahead_price
 01-01-2019 04:00:00,0.3085
 01-01-2019 05:00:00,0.3014
 01-01-2019 06:00:00,0.3017
-01-01-2019 07:00:00,0.30
+01-01-2019 07:00:00,0.3
 01-01-2019 08:00:00,0.3065
 01-01-2019 09:00:00,0.3065
 01-01-2019 10:00:00,0.3027
@@ -202,7 +202,7 @@ timestamp,day_ahead_price
 09-01-2019 08:00:00,0.4792
 09-01-2019 09:00:00,0.4568
 09-01-2019 10:00:00,0.4361
-09-01-2019 11:00:00,0.40
+09-01-2019 11:00:00,0.4
 09-01-2019 12:00:00,0.3706
 09-01-2019 13:00:00,0.3345
 09-01-2019 14:00:00,0.322
@@ -248,7 +248,7 @@ timestamp,day_ahead_price
 11-01-2019 06:00:00,0.2922
 11-01-2019 07:00:00,0.3122
 11-01-2019 08:00:00,0.3568
-11-01-2019 09:00:00,0.40
+11-01-2019 09:00:00,0.4
 11-01-2019 10:00:00,0.3801
 11-01-2019 11:00:00,0.379
 11-01-2019 12:00:00,0.3608
@@ -453,7 +453,7 @@ timestamp,day_ahead_price
 19-01-2019 19:00:00,0.4389
 19-01-2019 20:00:00,0.4114
 19-01-2019 21:00:00,0.3674
-19-01-2019 22:00:00,0.40
+19-01-2019 22:00:00,0.4
 19-01-2019 23:00:00,0.3615
 20-01-2019 00:00:00,0.3424
 20-01-2019 01:00:00,0.3401
@@ -463,7 +463,7 @@ timestamp,day_ahead_price
 20-01-2019 05:00:00,0.3423
 20-01-2019 06:00:00,0.4563
 20-01-2019 07:00:00,0.5597
-20-01-2019 08:00:00,0.60
+20-01-2019 08:00:00,0.6
 20-01-2019 09:00:00,0.5701
 20-01-2019 10:00:00,0.5063
 20-01-2019 11:00:00,0.4817
@@ -477,7 +477,7 @@ timestamp,day_ahead_price
 20-01-2019 19:00:00,0.5402
 20-01-2019 20:00:00,0.4868
 20-01-2019 21:00:00,0.4151
-20-01-2019 22:00:00,0.40
+20-01-2019 22:00:00,0.4
 20-01-2019 23:00:00,0.3403
 21-01-2019 00:00:00,0.3317
 21-01-2019 01:00:00,0.3301
@@ -660,7 +660,7 @@ timestamp,day_ahead_price
 28-01-2019 10:00:00,0.429
 28-01-2019 11:00:00,0.3993
 28-01-2019 12:00:00,0.3398
-28-01-2019 13:00:00,0.30
+28-01-2019 13:00:00,0.3
 28-01-2019 14:00:00,0.28
 28-01-2019 15:00:00,0.2791
 28-01-2019 16:00:00,0.2968
@@ -765,7 +765,7 @@ timestamp,day_ahead_price
 01-02-2019 19:00:00,0.1599
 01-02-2019 20:00:00,0.042
 01-02-2019 21:00:00,-0.08
-01-02-2019 22:00:00,0.0
+01-02-2019 22:00:00,0
 01-02-2019 23:00:00,-0.1116
 02-02-2019 00:00:00,-0.497
 02-02-2019 01:00:00,-0.101
@@ -850,7 +850,7 @@ timestamp,day_ahead_price
 05-02-2019 08:00:00,0.4916
 05-02-2019 09:00:00,0.4478
 05-02-2019 10:00:00,0.4137
-05-02-2019 11:00:00,0.40
+05-02-2019 11:00:00,0.4
 05-02-2019 12:00:00,0.3707
 05-02-2019 13:00:00,0.3516
 05-02-2019 14:00:00,0.3517
@@ -1250,7 +1250,7 @@ timestamp,day_ahead_price
 22-02-2019 00:00:00,0.802
 22-02-2019 01:00:00,0.012
 22-02-2019 02:00:00,0.01
-22-02-2019 03:00:00,0.0
+22-02-2019 03:00:00,0
 22-02-2019 04:00:00,-0.299
 22-02-2019 05:00:00,-0.246
 22-02-2019 06:00:00,-0.799
@@ -1270,7 +1270,7 @@ timestamp,day_ahead_price
 22-02-2019 20:00:00,0.006
 22-02-2019 21:00:00,-0.009
 22-02-2019 22:00:00,0.004
-22-02-2019 23:00:00,0.0
+22-02-2019 23:00:00,0
 23-02-2019 00:00:00,-0.487
 23-02-2019 01:00:00,-0.299
 23-02-2019 02:00:00,-0.262
@@ -1644,7 +1644,7 @@ timestamp,day_ahead_price
 10-03-2019 10:00:00,0.301
 10-03-2019 11:00:00,0.3177
 10-03-2019 12:00:00,0.3055
-10-03-2019 13:00:00,0.30
+10-03-2019 13:00:00,0.3
 10-03-2019 14:00:00,0.2969
 10-03-2019 15:00:00,0.2484
 10-03-2019 16:00:00,0.2264
@@ -1778,7 +1778,7 @@ timestamp,day_ahead_price
 16-03-2019 00:00:00,0.2001
 16-03-2019 01:00:00,0.2013
 16-03-2019 02:00:00,0.2004
-16-03-2019 03:00:00,0.20
+16-03-2019 03:00:00,0.2
 16-03-2019 04:00:00,0.1992
 16-03-2019 05:00:00,0.224
 16-03-2019 06:00:00,0.3385
@@ -1872,7 +1872,7 @@ timestamp,day_ahead_price
 19-03-2019 22:00:00,0.287
 19-03-2019 23:00:00,0.271
 20-03-2019 00:00:00,0.2518
-20-03-2019 01:00:00,0.20
+20-03-2019 01:00:00,0.2
 20-03-2019 02:00:00,0.2087
 20-03-2019 03:00:00,0.2072
 20-03-2019 04:00:00,0.25
@@ -1913,7 +1913,7 @@ timestamp,day_ahead_price
 21-03-2019 15:00:00,0.57
 21-03-2019 16:00:00,0.83
 21-03-2019 17:00:00,0.1501
-21-03-2019 18:00:00,0.20
+21-03-2019 18:00:00,0.2
 21-03-2019 19:00:00,0.2012
 21-03-2019 20:00:00,0.1534
 21-03-2019 21:00:00,0.929
@@ -1944,12 +1944,12 @@ timestamp,day_ahead_price
 22-03-2019 22:00:00,0.1479
 22-03-2019 23:00:00,0.1105
 23-03-2019 00:00:00,0.1207
-23-03-2019 01:00:00,0.10
+23-03-2019 01:00:00,0.1
 23-03-2019 02:00:00,0.1017
 23-03-2019 03:00:00,0.928
 23-03-2019 04:00:00,0.928
 23-03-2019 05:00:00,0.1276
-23-03-2019 06:00:00,0.20
+23-03-2019 06:00:00,0.2
 23-03-2019 07:00:00,0.2399
 23-03-2019 08:00:00,0.2008
 23-03-2019 09:00:00,0.1584
@@ -2058,7 +2058,7 @@ timestamp,day_ahead_price
 27-03-2019 16:00:00,0.1808
 27-03-2019 17:00:00,0.218
 27-03-2019 18:00:00,0.2672
-27-03-2019 19:00:00,0.30
+27-03-2019 19:00:00,0.3
 27-03-2019 20:00:00,0.2494
 27-03-2019 21:00:00,0.2319
 27-03-2019 22:00:00,0.2491
@@ -2146,7 +2146,7 @@ timestamp,day_ahead_price
 31-03-2019 08:00:00,0.2575
 31-03-2019 09:00:00,0.2394
 31-03-2019 10:00:00,0.1978
-31-03-2019 11:00:00,0.20
+31-03-2019 11:00:00,0.2
 31-03-2019 12:00:00,0.1839
 31-03-2019 13:00:00,0.175
 31-03-2019 14:00:00,0.176
@@ -2244,7 +2244,7 @@ timestamp,day_ahead_price
 04-04-2019 10:00:00,0.1306
 04-04-2019 11:00:00,0.1428
 04-04-2019 12:00:00,0.1082
-04-04-2019 13:00:00,0.10
+04-04-2019 13:00:00,0.1
 04-04-2019 14:00:00,0.988
 04-04-2019 15:00:00,0.1574
 04-04-2019 16:00:00,0.2151
@@ -2292,7 +2292,7 @@ timestamp,day_ahead_price
 06-04-2019 10:00:00,0.1119
 06-04-2019 11:00:00,0.1402
 06-04-2019 12:00:00,0.1055
-06-04-2019 13:00:00,0.10
+06-04-2019 13:00:00,0.1
 06-04-2019 14:00:00,0.1183
 06-04-2019 15:00:00,0.1483
 06-04-2019 16:00:00,0.2168
@@ -2371,7 +2371,7 @@ timestamp,day_ahead_price
 09-04-2019 17:00:00,0.2658
 09-04-2019 18:00:00,0.3092
 09-04-2019 19:00:00,0.3143
-09-04-2019 20:00:00,0.30
+09-04-2019 20:00:00,0.3
 09-04-2019 21:00:00,0.2792
 09-04-2019 22:00:00,0.25
 09-04-2019 23:00:00,0.2511
@@ -2415,7 +2415,7 @@ timestamp,day_ahead_price
 11-04-2019 13:00:00,0.51
 11-04-2019 14:00:00,0.728
 11-04-2019 15:00:00,0.1401
-11-04-2019 16:00:00,0.20
+11-04-2019 16:00:00,0.2
 11-04-2019 17:00:00,0.2897
 11-04-2019 18:00:00,0.3511
 11-04-2019 19:00:00,0.3595
@@ -2436,7 +2436,7 @@ timestamp,day_ahead_price
 12-04-2019 10:00:00,0.493
 12-04-2019 11:00:00,0.498
 12-04-2019 12:00:00,0.184
-12-04-2019 13:00:00,0.0
+12-04-2019 13:00:00,0
 12-04-2019 14:00:00,0.017
 12-04-2019 15:00:00,0.3
 12-04-2019 16:00:00,0.414
@@ -2644,7 +2644,7 @@ timestamp,day_ahead_price
 21-04-2019 02:00:00,-0.059
 21-04-2019 03:00:00,0.372
 21-04-2019 04:00:00,0.473
-21-04-2019 05:00:00,0.10
+21-04-2019 05:00:00,0.1
 21-04-2019 06:00:00,0.1613
 21-04-2019 07:00:00,0.1652
 21-04-2019 08:00:00,0.792
@@ -2720,12 +2720,12 @@ timestamp,day_ahead_price
 24-04-2019 06:00:00,0.3585
 24-04-2019 07:00:00,0.31
 24-04-2019 08:00:00,0.2184
-24-04-2019 09:00:00,0.20
+24-04-2019 09:00:00,0.2
 24-04-2019 10:00:00,0.1845
 24-04-2019 11:00:00,0.1615
 24-04-2019 12:00:00,0.1455
 24-04-2019 13:00:00,0.1202
-24-04-2019 14:00:00,0.10
+24-04-2019 14:00:00,0.1
 24-04-2019 15:00:00,0.1181
 24-04-2019 16:00:00,0.1562
 24-04-2019 17:00:00,0.1997
@@ -2903,8 +2903,8 @@ timestamp,day_ahead_price
 01-05-2019 21:00:00,0.2091
 01-05-2019 22:00:00,0.16
 01-05-2019 23:00:00,0.122
-02-05-2019 00:00:00,0.10
-02-05-2019 01:00:00,0.10
+02-05-2019 00:00:00,0.1
+02-05-2019 01:00:00,0.1
 02-05-2019 02:00:00,0.8
 02-05-2019 03:00:00,0.8
 02-05-2019 04:00:00,0.8
@@ -2934,11 +2934,11 @@ timestamp,day_ahead_price
 03-05-2019 04:00:00,0.1337
 03-05-2019 05:00:00,0.1156
 03-05-2019 06:00:00,0.1094
-03-05-2019 07:00:00,0.10
+03-05-2019 07:00:00,0.1
 03-05-2019 08:00:00,0.94
 03-05-2019 09:00:00,0.97
-03-05-2019 10:00:00,0.10
-03-05-2019 11:00:00,0.10
+03-05-2019 10:00:00,0.1
+03-05-2019 11:00:00,0.1
 03-05-2019 12:00:00,0.706
 03-05-2019 13:00:00,0.584
 03-05-2019 14:00:00,0.557
@@ -3000,7 +3000,7 @@ timestamp,day_ahead_price
 05-05-2019 22:00:00,0.2324
 05-05-2019 23:00:00,0.2099
 06-05-2019 00:00:00,0.2006
-06-05-2019 01:00:00,0.20
+06-05-2019 01:00:00,0.2
 06-05-2019 02:00:00,0.1904
 06-05-2019 03:00:00,0.1704
 06-05-2019 04:00:00,0.201
@@ -3154,7 +3154,7 @@ timestamp,day_ahead_price
 12-05-2019 08:00:00,0.24
 12-05-2019 09:00:00,0.2254
 12-05-2019 10:00:00,0.22
-12-05-2019 11:00:00,0.20
+12-05-2019 11:00:00,0.2
 12-05-2019 12:00:00,0.1803
 12-05-2019 13:00:00,0.1703
 12-05-2019 14:00:00,0.1705
@@ -3238,7 +3238,7 @@ timestamp,day_ahead_price
 15-05-2019 20:00:00,0.2525
 15-05-2019 21:00:00,0.2185
 15-05-2019 22:00:00,0.1886
-15-05-2019 23:00:00,0.20
+15-05-2019 23:00:00,0.2
 16-05-2019 00:00:00,0.1814
 16-05-2019 01:00:00,0.1708
 16-05-2019 02:00:00,0.1643
@@ -3382,7 +3382,7 @@ timestamp,day_ahead_price
 21-05-2019 20:00:00,0.2952
 21-05-2019 21:00:00,0.2412
 21-05-2019 22:00:00,0.2278
-21-05-2019 23:00:00,0.20
+21-05-2019 23:00:00,0.2
 22-05-2019 00:00:00,0.1703
 22-05-2019 01:00:00,0.155
 22-05-2019 02:00:00,0.1402
@@ -3464,7 +3464,7 @@ timestamp,day_ahead_price
 25-05-2019 06:00:00,0.2109
 25-05-2019 07:00:00,0.2206
 25-05-2019 08:00:00,0.2092
-25-05-2019 09:00:00,0.20
+25-05-2019 09:00:00,0.2
 25-05-2019 10:00:00,0.2094
 25-05-2019 11:00:00,0.175
 25-05-2019 12:00:00,0.1547
@@ -3516,7 +3516,7 @@ timestamp,day_ahead_price
 27-05-2019 10:00:00,0.2308
 27-05-2019 11:00:00,0.2204
 27-05-2019 12:00:00,0.2071
-27-05-2019 13:00:00,0.20
+27-05-2019 13:00:00,0.2
 27-05-2019 14:00:00,0.1999
 27-05-2019 15:00:00,0.1965
 27-05-2019 16:00:00,0.214
@@ -3813,7 +3813,7 @@ timestamp,day_ahead_price
 08-06-2019 19:00:00,0.3523
 08-06-2019 20:00:00,0.346
 08-06-2019 21:00:00,0.3305
-08-06-2019 22:00:00,0.30
+08-06-2019 22:00:00,0.3
 08-06-2019 23:00:00,0.2839
 09-06-2019 00:00:00,0.2579
 09-06-2019 01:00:00,0.2408
@@ -3870,7 +3870,7 @@ timestamp,day_ahead_price
 11-06-2019 04:00:00,0.1896
 11-06-2019 05:00:00,0.2156
 11-06-2019 06:00:00,0.2606
-11-06-2019 07:00:00,0.30
+11-06-2019 07:00:00,0.3
 11-06-2019 08:00:00,0.2896
 11-06-2019 09:00:00,0.2606
 11-06-2019 10:00:00,0.2551
@@ -3918,7 +3918,7 @@ timestamp,day_ahead_price
 13-06-2019 04:00:00,0.189
 13-06-2019 05:00:00,0.1933
 13-06-2019 06:00:00,0.1986
-13-06-2019 07:00:00,0.20
+13-06-2019 07:00:00,0.2
 13-06-2019 08:00:00,0.191
 13-06-2019 09:00:00,0.185
 13-06-2019 10:00:00,0.1811
@@ -4150,7 +4150,7 @@ timestamp,day_ahead_price
 22-06-2019 20:00:00,0.3739
 22-06-2019 21:00:00,0.3638
 22-06-2019 22:00:00,0.3301
-22-06-2019 23:00:00,0.30
+22-06-2019 23:00:00,0.3
 23-06-2019 00:00:00,0.2712
 23-06-2019 01:00:00,0.2588
 23-06-2019 02:00:00,0.244
@@ -4166,7 +4166,7 @@ timestamp,day_ahead_price
 23-06-2019 12:00:00,0.2823
 23-06-2019 13:00:00,0.2782
 23-06-2019 14:00:00,0.2865
-23-06-2019 15:00:00,0.30
+23-06-2019 15:00:00,0.3
 23-06-2019 16:00:00,0.33
 23-06-2019 17:00:00,0.3659
 23-06-2019 18:00:00,0.4451
@@ -4680,7 +4680,7 @@ timestamp,day_ahead_price
 14-07-2019 22:00:00,0.3702
 14-07-2019 23:00:00,0.3555
 15-07-2019 00:00:00,0.3022
-15-07-2019 01:00:00,0.30
+15-07-2019 01:00:00,0.3
 15-07-2019 02:00:00,0.2873
 15-07-2019 03:00:00,0.2984
 15-07-2019 04:00:00,0.3429
@@ -5420,7 +5420,7 @@ timestamp,day_ahead_price
 14-08-2019 18:00:00,0.4608
 14-08-2019 19:00:00,0.43
 14-08-2019 20:00:00,0.4206
-14-08-2019 21:00:00,0.40
+14-08-2019 21:00:00,0.4
 14-08-2019 22:00:00,0.3535
 14-08-2019 23:00:00,0.3836
 15-08-2019 00:00:00,0.339
@@ -5730,7 +5730,7 @@ timestamp,day_ahead_price
 27-08-2019 16:00:00,0.5959
 27-08-2019 17:00:00,0.7039
 27-08-2019 18:00:00,0.8991
-27-08-2019 19:00:00,0.90
+27-08-2019 19:00:00,0.9
 27-08-2019 20:00:00,0.69
 27-08-2019 21:00:00,0.579
 27-08-2019 22:00:00,0.4613
@@ -5772,7 +5772,7 @@ timestamp,day_ahead_price
 29-08-2019 10:00:00,0.3585
 29-08-2019 11:00:00,0.3099
 29-08-2019 12:00:00,0.3029
-29-08-2019 13:00:00,0.30
+29-08-2019 13:00:00,0.3
 29-08-2019 14:00:00,0.3167
 29-08-2019 15:00:00,0.3471
 29-08-2019 16:00:00,0.37
@@ -5819,7 +5819,7 @@ timestamp,day_ahead_price
 31-08-2019 09:00:00,0.6653
 31-08-2019 10:00:00,0.6541
 31-08-2019 11:00:00,0.6276
-31-08-2019 12:00:00,0.60
+31-08-2019 12:00:00,0.6
 31-08-2019 13:00:00,0.5748
 31-08-2019 14:00:00,0.5499
 31-08-2019 15:00:00,0.5895
@@ -5848,7 +5848,7 @@ timestamp,day_ahead_price
 01-09-2019 14:00:00,0.47
 01-09-2019 15:00:00,0.4858
 01-09-2019 16:00:00,0.5184
-01-09-2019 17:00:00,0.60
+01-09-2019 17:00:00,0.6
 01-09-2019 18:00:00,0.6702
 01-09-2019 19:00:00,0.6593
 01-09-2019 20:00:00,0.5532
@@ -5998,7 +5998,7 @@ timestamp,day_ahead_price
 07-09-2019 20:00:00,0.4601
 07-09-2019 21:00:00,0.3778
 07-09-2019 22:00:00,0.3224
-07-09-2019 23:00:00,0.30
+07-09-2019 23:00:00,0.3
 08-09-2019 00:00:00,0.2863
 08-09-2019 01:00:00,0.2626
 08-09-2019 02:00:00,0.2515
@@ -6071,7 +6071,7 @@ timestamp,day_ahead_price
 10-09-2019 21:00:00,0.4989
 10-09-2019 22:00:00,0.4398
 10-09-2019 23:00:00,0.4584
-11-09-2019 00:00:00,0.40
+11-09-2019 00:00:00,0.4
 11-09-2019 01:00:00,0.3938
 11-09-2019 02:00:00,0.3679
 11-09-2019 03:00:00,0.3685
@@ -6136,7 +6136,7 @@ timestamp,day_ahead_price
 13-09-2019 14:00:00,-0.129
 13-09-2019 15:00:00,0.1069
 13-09-2019 16:00:00,0.342
-13-09-2019 17:00:00,0.40
+13-09-2019 17:00:00,0.4
 13-09-2019 18:00:00,0.486
 13-09-2019 19:00:00,0.5092
 13-09-2019 20:00:00,0.4808
@@ -6148,7 +6148,7 @@ timestamp,day_ahead_price
 14-09-2019 02:00:00,0.3235
 14-09-2019 03:00:00,0.3232
 14-09-2019 04:00:00,0.3607
-14-09-2019 05:00:00,0.50
+14-09-2019 05:00:00,0.5
 14-09-2019 06:00:00,0.5834
 14-09-2019 07:00:00,0.6205
 14-09-2019 08:00:00,0.5593
@@ -6352,9 +6352,9 @@ timestamp,day_ahead_price
 22-09-2019 14:00:00,0.4832
 22-09-2019 15:00:00,0.5393
 22-09-2019 16:00:00,0.5892
-22-09-2019 17:00:00,0.70
+22-09-2019 17:00:00,0.7
 22-09-2019 18:00:00,0.864
-22-09-2019 19:00:00,0.70
+22-09-2019 19:00:00,0.7
 22-09-2019 20:00:00,0.5547
 22-09-2019 21:00:00,0.5019
 22-09-2019 22:00:00,0.4055
@@ -6474,7 +6474,7 @@ timestamp,day_ahead_price
 27-09-2019 16:00:00,0.3763
 27-09-2019 17:00:00,0.4623
 27-09-2019 18:00:00,0.5195
-27-09-2019 19:00:00,0.50
+27-09-2019 19:00:00,0.5
 27-09-2019 20:00:00,0.4648
 27-09-2019 21:00:00,0.4176
 27-09-2019 22:00:00,0.3784
@@ -6651,7 +6651,7 @@ timestamp,day_ahead_price
 05-10-2019 01:00:00,0.6
 05-10-2019 02:00:00,0.623
 05-10-2019 03:00:00,0.782
-05-10-2019 04:00:00,0.20
+05-10-2019 04:00:00,0.2
 05-10-2019 05:00:00,0.3507
 05-10-2019 06:00:00,0.4441
 05-10-2019 07:00:00,0.4702
@@ -6758,7 +6758,7 @@ timestamp,day_ahead_price
 09-10-2019 12:00:00,0.3891
 09-10-2019 13:00:00,0.3776
 09-10-2019 14:00:00,0.3864
-09-10-2019 15:00:00,0.40
+09-10-2019 15:00:00,0.4
 09-10-2019 16:00:00,0.4363
 09-10-2019 17:00:00,0.4592
 09-10-2019 18:00:00,0.5129
@@ -6803,7 +6803,7 @@ timestamp,day_ahead_price
 11-10-2019 09:00:00,0.3152
 11-10-2019 10:00:00,0.3367
 11-10-2019 11:00:00,0.3341
-11-10-2019 12:00:00,0.30
+11-10-2019 12:00:00,0.3
 11-10-2019 13:00:00,0.2777
 11-10-2019 14:00:00,0.2802
 11-10-2019 15:00:00,0.2958
@@ -6890,7 +6890,7 @@ timestamp,day_ahead_price
 15-10-2019 00:00:00,0.2748
 15-10-2019 01:00:00,0.2735
 15-10-2019 02:00:00,0.2754
-15-10-2019 03:00:00,0.30
+15-10-2019 03:00:00,0.3
 15-10-2019 04:00:00,0.3168
 15-10-2019 05:00:00,0.3649
 15-10-2019 06:00:00,0.4305
@@ -6929,7 +6929,7 @@ timestamp,day_ahead_price
 16-10-2019 15:00:00,0.4756
 16-10-2019 16:00:00,0.499
 16-10-2019 17:00:00,0.5428
-16-10-2019 18:00:00,0.60
+16-10-2019 18:00:00,0.6
 16-10-2019 19:00:00,0.4957
 16-10-2019 20:00:00,0.4608
 16-10-2019 21:00:00,0.4258
@@ -7274,7 +7274,7 @@ timestamp,day_ahead_price
 31-10-2019 00:00:00,0.3504
 31-10-2019 01:00:00,0.315
 31-10-2019 02:00:00,0.298
-31-10-2019 03:00:00,0.30
+31-10-2019 03:00:00,0.3
 31-10-2019 04:00:00,0.2854
 31-10-2019 05:00:00,0.2844
 31-10-2019 06:00:00,0.3053
@@ -7524,14 +7524,14 @@ timestamp,day_ahead_price
 10-11-2019 10:00:00,0.5297
 10-11-2019 11:00:00,0.5239
 10-11-2019 12:00:00,0.5082
-10-11-2019 13:00:00,0.50
+10-11-2019 13:00:00,0.5
 10-11-2019 14:00:00,0.5121
 10-11-2019 15:00:00,0.5716
 10-11-2019 16:00:00,0.5747
 10-11-2019 17:00:00,0.7972
 10-11-2019 18:00:00,0.6833
 10-11-2019 19:00:00,0.5785
-10-11-2019 20:00:00,0.50
+10-11-2019 20:00:00,0.5
 10-11-2019 21:00:00,0.4478
 10-11-2019 22:00:00,0.4289
 10-11-2019 23:00:00,0.3703
@@ -7544,8 +7544,8 @@ timestamp,day_ahead_price
 11-11-2019 06:00:00,0.4548
 11-11-2019 07:00:00,0.5095
 11-11-2019 08:00:00,0.5176
-11-11-2019 09:00:00,0.50
-11-11-2019 10:00:00,0.50
+11-11-2019 09:00:00,0.5
+11-11-2019 10:00:00,0.5
 11-11-2019 11:00:00,0.5043
 11-11-2019 12:00:00,0.48
 11-11-2019 13:00:00,0.4824
@@ -7562,7 +7562,7 @@ timestamp,day_ahead_price
 12-11-2019 00:00:00,0.3267
 12-11-2019 01:00:00,0.3299
 12-11-2019 02:00:00,0.3116
-12-11-2019 03:00:00,0.30
+12-11-2019 03:00:00,0.3
 12-11-2019 04:00:00,0.2918
 12-11-2019 05:00:00,0.3345
 12-11-2019 06:00:00,0.3982
@@ -7697,7 +7697,7 @@ timestamp,day_ahead_price
 17-11-2019 15:00:00,0.4328
 17-11-2019 16:00:00,0.438
 17-11-2019 17:00:00,0.4725
-17-11-2019 18:00:00,0.50
+17-11-2019 18:00:00,0.5
 17-11-2019 19:00:00,0.4751
 17-11-2019 20:00:00,0.4383
 17-11-2019 21:00:00,0.366
@@ -8053,7 +8053,7 @@ timestamp,day_ahead_price
 02-12-2019 11:00:00,0.9519
 02-12-2019 12:00:00,0.8495
 02-12-2019 13:00:00,0.829
-02-12-2019 14:00:00,0.90
+02-12-2019 14:00:00,0.9
 02-12-2019 15:00:00,0.8809
 02-12-2019 16:00:00,0.1054
 02-12-2019 17:00:00,0.11056
@@ -8344,7 +8344,7 @@ timestamp,day_ahead_price
 14-12-2019 14:00:00,0.4905
 14-12-2019 15:00:00,0.5413
 14-12-2019 16:00:00,0.54
-14-12-2019 17:00:00,0.60
+14-12-2019 17:00:00,0.6
 14-12-2019 18:00:00,0.5903
 14-12-2019 19:00:00,0.5478
 14-12-2019 20:00:00,0.4932
@@ -8423,7 +8423,7 @@ timestamp,day_ahead_price
 17-12-2019 21:00:00,0.4504
 17-12-2019 22:00:00,0.451
 17-12-2019 23:00:00,0.3896
-18-12-2019 00:00:00,0.40
+18-12-2019 00:00:00,0.4
 18-12-2019 01:00:00,0.367
 18-12-2019 02:00:00,0.3658
 18-12-2019 03:00:00,0.3577
@@ -8542,7 +8542,7 @@ timestamp,day_ahead_price
 22-12-2019 20:00:00,0.4787
 22-12-2019 21:00:00,0.4228
 22-12-2019 22:00:00,0.4398
-22-12-2019 23:00:00,0.40
+22-12-2019 23:00:00,0.4
 23-12-2019 00:00:00,0.386
 23-12-2019 01:00:00,0.342
 23-12-2019 02:00:00,0.3357
@@ -8652,7 +8652,7 @@ timestamp,day_ahead_price
 27-12-2019 10:00:00,-0.1984
 27-12-2019 11:00:00,-0.121
 27-12-2019 12:00:00,-0.2668
-27-12-2019 13:00:00,-0.30
+27-12-2019 13:00:00,-0.3
 27-12-2019 14:00:00,-0.3306
 27-12-2019 15:00:00,-0.2996
 27-12-2019 16:00:00,-0.777
@@ -8728,7 +8728,7 @@ timestamp,day_ahead_price
 30-12-2019 14:00:00,0.5395
 30-12-2019 15:00:00,0.5561
 30-12-2019 16:00:00,0.5608
-30-12-2019 17:00:00,0.60
+30-12-2019 17:00:00,0.6
 30-12-2019 18:00:00,0.5632
 30-12-2019 19:00:00,0.536
 30-12-2019 20:00:00,0.5238
diff --git a/runme_community.py b/runme_community.py
index 7d36ebd2385617116f915bee68c0306d42f65bf9..862acd2ea87b70582a5a5770c02a469bfc6d8715 100644
--- a/runme_community.py
+++ b/runme_community.py
@@ -5,6 +5,7 @@ import Model_Library.Prosumer.main as main
 import Model_Library.District.main_district as main_district
 from functools import partial
 from multiprocessing import Pool
+import ray
 from tqdm import tqdm
 import os
 
@@ -20,60 +21,37 @@ def process_each_prosumer(prosumer_name, prosumer_specification, input_profiles,
     return prosumer.prosumer
 
 t_start = pd.Timestamp("2019-01-01 00:00:00") # start time of simulation
-t_horizon = 8760 # number of time steps to be simulated
+t_horizon = 100 # number of time steps to be simulated
 t_step = 1 # length of a time step in hours
-'''
-input_profile_dict = {'irradiance_1': ['irradiance', 'input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv'],
-                      'temperature_1': ['air_temperature', 'input_files/data/temperature/temperature.csv'],
-                      'demand_electric_1': ['elec_demand', 'generate', 3000],
-                      'demand_heat_1': ['therm_demand', 'generate', 6000, 'temperature_1'],
-                      'demand_hot_water_1': ['hot_water_demand', 'generate', 1500, 'temperature_1'],
-                      'irradiance_2': ['irradiance', 'input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv'],
-                      'temperature_2': ['air_temperature', 'input_files/data/temperature/temperature.csv'],
-                      'demand_electric_2': ['elec_demand', 'generate', 3000],
-                      'demand_heat_2': ['therm_demand', 'generate', 6000, 'temperature_2'],
-                      'demand_hot_water_2': ['hot_water_demand', 'generate', 1500, 'temperature_2'],
-                      'irradiance_3': ['irradiance', 'input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv'],
-                      'temperature_3': ['air_temperature', 'input_files/data/temperature/temperature.csv'],
-                      'demand_electric_3': ['elec_demand', 'generate', 0],
-                      'demand_heat_3': ['therm_demand', 'generate', 0, 'temperature_3'],
-                      'demand_hot_water_3': ['hot_water_demand', 'generate', 0, 'temperature_3'],
-                      'elec_price_1': ['elec_price', 'input_files/data/prices/day-ahead/hourly_price.csv']}'''
 
 # 'topology_path': path to directory that contains the matrices that define the prosumer topology
 # 'config_path': path to global configurations like prices, injection prices, emission costs, etc.
-'''
-prosumer_dict = {'SCN2_CAT1_PV11_3000_6000':{'topology_path': 'input_files/models/prosumer_models/SCN2_CAT1_PV11',
-                                             'config_path': 'input_files/models/prosumer_models/SCN2_CAT1_PV11/config.csv',
-                                             'profiles': {'irradiance': 'irradiance_1',
-                                                          'air_temperature': 'temperature_1',
-                                                          'elec_demand': 'demand_electric_1',
-                                                          'therm_demand': 'demand_heat_1',
-                                                          'hot_water_demand': 'demand_hot_water_1'}},
-                 'SCN0_CAT1_3000_6000': {'topology_path': 'input_files/models/prosumer_models/SCN0_CAT1',
-                                         'config_path': 'input_files/models/prosumer_models/SCN0_CAT1/config.csv',
-                                         'profiles': {'irradiance': 'irradiance_2',
-                                                      'air_temperature': 'temperature_2',
-                                                      'elec_demand': 'demand_electric_2',
-                                                      'therm_demand': 'demand_heat_2',
-                                                      'hot_water_demand': 'demand_hot_water_2'}}}'''
+# start community at 17:51
+community=[77, 215, 179]
+for c in community:
+    #change inputpath
+    pass
+#--------------------------------change line 67 of main to change output folder----------------------------------------#
 prosumer_dict = {}
-inputpath_dataframe='C:/GIT/ineed-dc-framework/Tooling/quarter_data_extraction/DataFrame/OUTPUT/OUTPUT_S3B/Quarter_Prosumers/running_info.csv'
+inputpath_dataframe='/home/jou-fsa/PycharmProjects/ineed-dc-framework/input_files/models/prosumer_models/Building_2019/running_77_2019.csv'
 b=pd.read_csv(inputpath_dataframe)
-input_profile_dict = {'irradiance': ['irradiance', 'input_files/data/irradiance/irr_ren_ninja_avg_Germany.csv'],
-                      'temperature': ['air_temperature', 'input_files/data/temperature/temperature_ren_ninja_avrg_germany.csv'],
-                      'elec_price_1': ['elec_price', 'input_files/data/prices/day-ahead/hourly_price.csv']}
+input_profile_dict = {'irradiance': ['irradiance', '/home/jou-fsa/PycharmProjects/ineed-dc-framework/input_files/data/irradiance/irr_ren_ninja_avg_Germany.csv'],
+                      'temperature': ['air_temperature', '/home/jou-fsa/PycharmProjects/ineed-dc-framework/input_files/data/temperature/temperature_ren_ninja_avrg_germany.csv'],
+                      'elec_price_1': ['elec_price', '/home/jou-fsa/PycharmProjects/ineed-dc-framework/input_files/data/prices/day-ahead/hourly_price.csv']}
 for i in b.index:
     input_profile_dict['demand_electric_'+ str(i)] = ['elec_demand', 'generate', b.loc[i,'referance_el_demand'], b.loc[i,'profile_el']]
     input_profile_dict['demand_heat_'+ str(i)] = ['therm_demand', 'generate', b.loc[i,'referance_heat_demand'],b.loc[i,'profile_th'], b.loc[i,'Building_type'], 'temperature']
     input_profile_dict['demand_hot_water_'+ str(i)] = ['hot_water_demand', 'generate', b.loc[i,'referance_hot_water'], b.loc[i,'profile_th'], b.loc[i,'Building_type'], 'temperature']
-    prosumer_dict[b.loc[i,'ID_Building']]= {'topology_path': 'Tooling/quarter_data_extraction/DataFrame/OUTPUT/OUTPUT_S3B/Quarter_Prosumers/'+str(b.loc[i,'ID_Building']),
-                                            'config_path': 'Tooling/quarter_data_extraction/DataFrame/OUTPUT/OUTPUT_S3B/Quarter_Prosumers/'+str(b.loc[i,'ID_Building'])+'/config.csv',
+    prosumer_dict[b.loc[i,'name_building']]= {'topology_path': '/home/jou-fsa/PycharmProjects/ineed-dc-framework/input_files/models/prosumer_models/Building_2019/'+str(b.loc[i,'ID_Building']),
+                                            'config_path': '/home/jou-fsa/PycharmProjects/ineed-dc-framework/input_files/models/prosumer_models/Building_2019/'+str(b.loc[i,'ID_Building'])+'/config.csv',
                                             'profiles':{'irradiance': 'irradiance',
                                                        'air_temperature': 'temperature',
                                                        'elec_demand': 'demand_electric_'+ str(i),
                                                        'therm_demand':'demand_heat_'+ str(i),
-                                                       'hot_water_demand': 'demand_hot_water_'+ str(i)}}
+                                                       'hot_water_demand': 'demand_hot_water_'+ str(i),
+                                                       'elec_prices_da': 'elec_price_1'}}
+
+    #'elec_prices_da': 'elec_price_1'
 
 input_profiles = Tooling.input_profile_processor.input_profile_processor.process_input_profiles(input_profile_dict, t_start, t_horizon, t_step)
 prosumer_strategy = ['annuity']
@@ -81,17 +59,30 @@ parallel_processing = False
 
 # Run multiple independent prosumers in parallel on multiple cores
 prosumers = dict.fromkeys(prosumer_dict.keys())
+count_process=len(prosumer_dict.keys())
+#count_process = 10
+ray.init(num_cpus=count_process, local_mode=(not(parallel_processing)))
 if parallel_processing:
-    count_processes = len(prosumer_dict.keys())
-    pool = Pool(os.cpu_count())
-    parallel_func = partial(process_each_prosumer, input_profiles = input_profiles, t_start = t_start, t_horizon = t_horizon, t_step = t_step, prosumer_strategy = prosumer_strategy)
-    mapped_values = list(tqdm(pool.map(parallel_func, list(prosumer_dict.keys()), list(prosumer_dict.values())), total = count_processes))
+    process_each_prosumer_id=ray.remote(process_each_prosumer)
+    results_ids=[process_each_prosumer_id.remote(prosumer_name, prosumer_dict[prosumer_name], input_profiles, t_start, t_horizon, t_step, prosumer_strategy) for prosumer_name in prosumer_dict.keys()]
+    while results_ids:
+        finished, results_ids = ray.wait(results_ids)
+        for id in finished:
+            val=ray.get(id)
+            prosumers[ray.get(val.get_name.remote())]=val
+    #count_processes = len(prosumer_dict.keys())
+    #pool = Pool(os.cpu_count())
+    #parallel_func = partial(process_each_prosumer, input_profiles = input_profiles, t_start = t_start, t_horizon = t_horizon, t_step = t_step, prosumer_strategy = prosumer_strategy)
+    #mapped_values = list(tqdm(pool.map(parallel_func, list(prosumer_dict.keys()), list(prosumer_dict.values())), total = count_processes))
 # Normal processing, one core only
 else:
     for prosumer_name in list(prosumer_dict.keys()):
-        prosumers[prosumer_name] = process_each_prosumer(prosumer_name, prosumer_dict[prosumer_name], input_profiles, t_start, t_horizon, t_step, prosumer_strategy)
+        try:
+            prosumers[prosumer_name] = process_each_prosumer(prosumer_name, prosumer_dict[prosumer_name], input_profiles, t_start, t_horizon, t_step, prosumer_strategy)
+        except KeyError:
+            print('Infeasible')
+            pass
 
-'''
 community_assets_dict = {'ca_bat': {'topology_path': 'input_files/models/district_models/example_CA',
                                     'config_path': 'input_files/models/district_models/example_CA/config.csv',
                                     'profiles': {'irradiance': 'irradiance_3',
@@ -111,4 +102,5 @@ community_dict = {'community': {'config_path': 'input_files/models/district_mode
 community_strategy = ['max_operational_profit']
 
 community_main = main_district.MainDistrict(community_dict, prosumers, community_assets, input_profiles, t_start, t_horizon, t_step, community_assets_strategy, community_strategy)
-'''
\ No newline at end of file
+
+ray.shutdown()