diff --git a/Model_Library b/Model_Library
index 4e49b79efb7880004cf752c3c4b9d5035280b8b2..bcb9d840108bdc819b5f9f78c82acedfaf32bcc0 160000
--- a/Model_Library
+++ b/Model_Library
@@ -1 +1 @@
-Subproject commit 4e49b79efb7880004cf752c3c4b9d5035280b8b2
+Subproject commit bcb9d840108bdc819b5f9f78c82acedfaf32bcc0
diff --git a/Tooling b/Tooling
index 48c245ed54aca35689bffd960030ba1f4422598d..3297d3d3bc34991d70c52a7ec72bc93424226b84 160000
--- a/Tooling
+++ b/Tooling
@@ -1 +1 @@
-Subproject commit 48c245ed54aca35689bffd960030ba1f4422598d
+Subproject commit 3297d3d3bc34991d70c52a7ec72bc93424226b84
diff --git a/input_files/convert_input_files_input_profile_processor.py b/input_files/convert_input_files_input_profile_processor.py
new file mode 100644
index 0000000000000000000000000000000000000000..16873c35a282ed11379b932ae51d7f5916f6c85f
--- /dev/null
+++ b/input_files/convert_input_files_input_profile_processor.py
@@ -0,0 +1,16 @@
+"""
+This script inspects the input files and modifies them such that they adhere to the new input file specification used by the framework after merge of merge request !13 Input Profile Processor.
+This script assumes that the file containing the paths to the files containing the input profiles is called "data_path.csv".
+"""
+
+import os.path
+
+changed_files = []
+for dirpath, dirnames, filenames in os.walk(".\\input_files"):
+    for filename in filenames:
+        if filename == "data_path.csv":
+            print(f"Inspecting file {os.path.join(dirpath, filename)}")
+            changed_files.append(os.path.join(dirpath, filename))
+            os.remove(os.path.join(dirpath, filename))
+for file in changed_files:
+    print(f"Modified file {file}!")
diff --git a/input_files/convert_input_files_refactoring_part_1.py b/input_files/convert_input_files_refactoring_part_1.py
new file mode 100644
index 0000000000000000000000000000000000000000..c69a42ba7627bd5de13ba49fb14af4829fdbe9d3
--- /dev/null
+++ b/input_files/convert_input_files_refactoring_part_1.py
@@ -0,0 +1,79 @@
+"""
+This script inspects the input files and modifies them such that they adhere to the new input file specification used by the framework after merge of merge request !12 Refactoring Part 1.
+"""
+
+import os.path
+import pandas as pd
+
+def read_matrix(df):
+    matrix = []
+    for i in df.index:
+        matrix_row = []
+        for j in df.index:
+            matrix_row.append(df[df["comp_name"][j]][i])
+        matrix.append(matrix_row)
+    return matrix
+
+def read_components(df):
+    components = {}
+    for i in df.index:
+        components[df["comp_name"][i]] = i
+    return components
+
+def get_connection(matrix, components, comp_from, comp_to):
+    return matrix[components[comp_from]][components[comp_to]]
+
+def set_connection(matrix, components, comp_from, comp_to, value):
+    matrix[components[comp_from]][components[comp_to]] = value
+
+def write_matrix(df, matrix):
+    for i in df.index:
+        for j in df.index:
+            df.loc[i, df["comp_name"][j]] = matrix[i][j]
+
+changed_files = []
+invalid_files = []
+for dirpath, dirnames, filenames in os.walk(".\\input_files"):
+    for filename in filenames:
+        matrix_names = ["elec_matrix.csv", "gas_matrix.csv", "hydro_matrix.csv", "therm_matrix.csv"]
+        consumption_component_names = ["ChargingInfrastructure", "StandardElectricalConsumption", "HeadConsumption", "Radiator", "HotWaterConsumption"]
+        if filename.find('matrix') and filename.endswith('.csv') and (filename.find('elec') is not -1 or filename.find('gas') is not -1 or filename.find('hydro') is not -1 or filename.find('therm') is not -1):
+            try:
+                print(f"Inspecting file {os.path.join(dirpath, filename)}")
+                df = pd.read_csv(os.path.join(dirpath, filename))
+                file_changed = False
+                matrix = read_matrix(df)
+                components = read_components(df)
+                for component in components.keys():
+                    if df["comp_type"][components[component]] in consumption_component_names:
+                        receives_from = []
+                        gives_to = []
+                        for other_component in components.keys():
+                            if get_connection(matrix, components, other_component, component) == 1:
+                                receives_from.append(other_component)
+                            if get_connection(matrix, components, component, other_component) == 1:
+                                gives_to.append(other_component)
+                        if len(gives_to) != 0:
+                            file_changed = True
+                            for recieving_component in gives_to:
+                                set_connection(matrix, components, component, recieving_component, 0)
+                                for giving_component in receives_from:
+                                    set_connection(matrix, components, giving_component, recieving_component, 1)
+                if file_changed:
+                    changed_files.append(os.path.join(dirpath, filename))
+                    write_matrix(df, matrix)
+                    df.to_csv(os.path.join(dirpath, "temp.csv"), index = False)
+                    df_str = pd.read_csv(os.path.join(dirpath, "temp.csv"), dtype = str, keep_default_na = False)
+                    for i in df.columns:
+                        if issubclass(type(df[i][0]), float):
+                            for j in df.index:
+                                if len(df_str[i][j]) != 0 and df_str[i][j].endswith(".0"):
+                                    df_str[i][j] = f"{df[i][j]:.0f}"
+                    df_str.to_csv(os.path.join(dirpath, filename), index = False)
+                    os.remove(os.path.join(dirpath, "temp.csv"))
+            except KeyError:
+                invalid_files.append(os.path.join(dirpath, filename))
+for file in changed_files:
+    print(f"Modified file {file}!")
+for file in invalid_files:
+    print(f"File {file} breaks some part of the input file specification that during the refactoring!")
diff --git a/input_files/models/district_models/example_CA/data_path.csv b/input_files/models/district_models/example_CA/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/district_models/example_CA/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/district_models/example_community/data_path.csv b/input_files/models/district_models/example_community/data_path.csv
deleted file mode 100644
index e0a77e063aad3d88e2eef7d788cd38527bc3d28a..0000000000000000000000000000000000000000
--- a/input_files/models/district_models/example_community/data_path.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,path,unit
-elec_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/district_models/jbr_test_ca/data_path.csv b/input_files/models/district_models/jbr_test_ca/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/district_models/jbr_test_ca/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/district_models/jbr_test_comm/data_path.csv b/input_files/models/district_models/jbr_test_comm/data_path.csv
deleted file mode 100644
index e0a77e063aad3d88e2eef7d788cd38527bc3d28a..0000000000000000000000000000000000000000
--- a/input_files/models/district_models/jbr_test_comm/data_path.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,path,unit
-elec_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN0_CAT1/data_path.csv b/input_files/models/prosumer_models/SCN0_CAT1/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN0_CAT1/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV11/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV11/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV11/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV31/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV31/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV31/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/data_path.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV11/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV11/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV11/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV31/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV31/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV31/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/data_path.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/data_path.csv
deleted file mode 100644
index 8d989a9b0ec55857e12044e661eb076b1e72e12a..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/data_path.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
-day_ahead_price,input_files/data/prices/day-ahead/hourly_price.csv,h
diff --git a/input_files/models/prosumer_models/jbr_test/data_path.csv b/input_files/models/prosumer_models/jbr_test/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/jbr_test/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/mfh_quartal/data_path.csv b/input_files/models/prosumer_models/mfh_quartal/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/mfh_quartal/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/input_files/models/prosumer_models/office_pv_heatpump/data_path.csv b/input_files/models/prosumer_models/office_pv_heatpump/data_path.csv
deleted file mode 100644
index aa0479f160f0098ef724bba48c299f1cb0ca738d..0000000000000000000000000000000000000000
--- a/input_files/models/prosumer_models/office_pv_heatpump/data_path.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-type,path,unit
-demand_electric,generate,h
-demand_heat,generate,h
-irradiance,input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv,min
-temperature,input_files/data/temperature/temperature.csv,h
diff --git a/runme_community.py b/runme_community.py
index e5ab450ab64488ab58d594283e8414d9c742f9a8..e77747b54386a2fc82b9e793048e67c07dfd45d2 100644
--- a/runme_community.py
+++ b/runme_community.py
@@ -1,134 +1,92 @@
-# runme.py is the central script to execute the optimization of the community.
-
 import time
 import pandas as pd
+import Tooling.input_profile_processor.input_profile_processor
 import Model_Library.Prosumer.main as main
+import Model_Library.District.main_district as main_district
 from functools import partial
 from multiprocessing import Pool
 from tqdm import tqdm
 import os
 
-from Model_Library.Prosumer.scripts.results_evaluation.results_evaluation import Plot_savings
-
-import Model_Library.District.main_district as main_district
-
-def process_each_prosumer(prosumer_name, prosumer_specification, commentary, t_start, t_horizon, t_step, predictions, t_history, prosumer_strategy):
-    try:
-        # Start main programme
-        prosumer = main.Main(prosumer_name, prosumer_specification, t_start, t_horizon, t_step, predictions, t_history, commentary)
-
-        # Run optimization
-        prosumer.run_optimization(prosumer_strategy)
-
-        # Show results - Results are only plotted after last iteration of rolling horizon
-        prosumer.show_results()
-
-        return prosumer.prosumer
-    except ValueError:
-        print(prosumer_name+" could not be optimized!")
-
-# # MAIN PROGRAM -------------------------------------------------------------------------------------------------------
-if __name__ == "__main__":
-    # Initialization scenario path and global variables for the prosumer optimization
-    t_start = pd.Timestamp("2019-05-10 00:00:00") # start time of simulation
-    t_horizon = 240 # number of time steps to be simulated
-    t_step = 1 # length of a time step in hours
-    t_history = 0 # number of hours before actual simulation interval for the demand generator to be able to make required predictions
-
-    # Path to local data - this is only used when selecting local mode
-    # 'data_path': path to file specifying where input profiles are located
-    # 'topology_path': path to 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':{'elec_demand': 3000,
-                                                 'therm_demand': 6000,
-                                                 'hot_water_demand': 1500,
-                                                 'topology_path': 'input_files/models/prosumer_models/SCN2_CAT1_PV11',
-                                                 'config_path': 'input_files/models/prosumer_models/SCN2_CAT1_PV11/config.csv',
-                                                 'data_path': 'input_files/models/prosumer_models/SCN2_CAT1_PV11/data_path.csv'},
-                     'SCN0_CAT1_3000_6000': {'elec_demand': 3000,
-                                             'therm_demand': 6000,
-                                             'hot_water_demand': 1500,
-                                             'topology_path': 'input_files/models/prosumer_models/SCN0_CAT1',
-                                             'config_path': 'input_files/models/prosumer_models/SCN0_CAT1/config.csv',
-                                             'data_path': 'input_files/models/prosumer_models/SCN0_CAT1/data_path.csv'}}
-    
-    ps_strategy = ['annuity']
-
-    # Prediction settings
-    predictions = {'demand_electric': 'ActualData',
-                   'demand_heat': 'ActualData',
-                   'day_ahead_price': 'ActualData',
-                   'intraday_price': 'ActualData',
-                   'solar_radiation': 'ActualData',
-                   # currently the method generate_g_t_series takes the same t_start as the prediction -> no historical
-                   # data for the prediction available: easy fix would be to set a minus time delta in the t_start
-                   # argument of generate_g_t_series
-                   'temperature': 'ActualData'}
-
-    reference_results = {}
-    commentary = False
-    parallel_processing = False
-
-    # Start program
-    # Run multiple independent prosumers in parallel on multiple cores
-    final_prosumer_dict = dict.fromkeys(prosumer_dict.keys())
-    if parallel_processing:
-        count_processes = len(prosumer_dict.keys())
-        pool = Pool(os.cpu_count())
-        parallel_func = partial(process_each_prosumer, commentary = commentary, t_start = t_start, t_horizon = t_horizon, t_step = t_step, predictions = predictions, t_history = t_history, prosumer_strategy = ps_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()):
-            final_prosumer_dict[prosumer_name] = process_each_prosumer(prosumer_name, prosumer_dict[prosumer_name], commentary, t_start, t_horizon, t_step, predictions, t_history, ps_strategy)
-
-    if reference_results:
-        for topology in prosumer_name:
-            Plot_savings(reference_results, topology)
-
-'-----------------COMMUNITY-PART----------------------------------'
-
-"------------------------Communnity Asset---------------------------"
-"-------------------------------------------------------------------"
-
-topology_path = 'input_files/models/district_models/example_CA'
-config_path = topology_path + '/config.csv'
-data_path = topology_path + '/data_path.csv'
-ca_dict = {'ca_bat': {'elec_demand': 0,
-                      'therm_demand': 0,
-                      'hot_water_demand': 0,
-                      'topology_path': topology_path,
-                      'config_path': config_path,
-                      'data_path': data_path}}
-
-ca_strategy = 'sizing_max_operational_profit'
-
-# initialize community component in the same way prosumers are.
-# The difference is that they are not directly optimized
-comm_assets = main.Main_CA(ca_dict, t_start, t_horizon, t_step, predictions, t_history, commentary)
-
-"""---------------------------COMMUNITY-LEVEL----------------------"""
-"""----------------------------------------------------------------"""
-
-topology_path = 'input_files/models/district_models/example_community'
-config_path = topology_path + '/config.csv'
-data_path = topology_path + '/data_path.csv'
-comm_dict = {'community': {'topology_path':topology_path,
-                           'config_path': config_path,
-                           'data_path': data_path}}
-
-comm_strategy = ['max_operational_profit']
-
-community_main = main_district.MainDistrict(final_prosumer_dict,
-                                            comm_assets,
-                                            t_start,
-                                            t_horizon,
-                                            t_step,
-                                            comm_dict,
-                                            ca_strategy,
-                                            comm_strategy)
-
-# ------------POST-PROCESS-----------------
-
-
-
+def process_each_prosumer(prosumer_name, prosumer_specification, input_profiles, t_start, t_horizon, t_step, prosumer_strategy):
+    prosumer = main.Main(prosumer_name, prosumer_specification, input_profiles, t_start, t_horizon, t_step)
+
+    prosumer.run_optimization(prosumer_strategy)
+
+    prosumer.show_results()
+
+    return prosumer.prosumer
+
+t_start = pd.Timestamp("2019-05-10 00:00:00") # start time of simulation
+t_horizon = 240 # 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']}
+
+input_profiles = Tooling.input_profile_processor.input_profile_processor.process_input_profiles(input_profile_dict, t_start, t_horizon, t_step)
+
+# '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'}}}
+
+prosumer_strategy = ['annuity']
+parallel_processing = False
+
+# Run multiple independent prosumers in parallel on multiple cores
+prosumers = dict.fromkeys(prosumer_dict.keys())
+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))
+# 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)
+
+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',
+                                                 'air_temperature': 'temperature_3',
+                                                 'elec_demand': 'demand_electric_3',
+                                                 'therm_demand': 'demand_heat_3',
+                                                 'hot_water_demand': 'demand_hot_water_3'}}}
+
+community_assets_strategy = 'sizing_max_operational_profit'
+
+community_assets = main.Main_CA(community_assets_dict, input_profiles, t_start, t_horizon, t_step)
+
+community_dict = {'community': {'config_path': 'input_files/models/district_models/example_community/config.csv',
+                                'profiles': {'elec_price': 'elec_price_1'}}}
+
+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)