Skip to content

Commit 220c73a

Browse files
committed
Adding files for the jupyter notebooks
Former-commit-id: 65f5898
1 parent 4f50cc4 commit 220c73a

File tree

49 files changed

+29
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+29
-176
lines changed

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/low_demand/physical_process.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/low_demand/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/low_demand/plc1_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/low_demand/plc2_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/low_demand/scada-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/low_demand/scada_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/physical_process.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/physical_results.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/plc1_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/plc2-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/plc2_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/pump_behavior_pdd.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/scada-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/even_older/scada_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/plc2-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/plc2_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/scada-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/old/scada_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/plc1_full_control/physical_process.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/plc1_full_control/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/plc1_full_control/plc1_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_0_5/physical_process.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_0_5/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_0_5/plc1_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_0_5/plc2_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_0_5/scada-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_0_5/scada_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/physical_process.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/plc1_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/plc2-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/plc2_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/scada-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/sleep_1/scada_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/thread_on_get/physical_process.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/thread_on_get/plc1-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/thread_on_get/plc1_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/thread_on_get/plc2_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/thread_on_get/scada-eth0.pcap.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

ICS_topologies/minitown_topology/pressure_driven_data/no_attack/thread_on_get/scada_saved_tank_levels_received.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

Jupyter_notebooks/pressure_driven_attack_experiments/minitown_experiments_attack_plc1.ipynb

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

Jupyter_notebooks/pressure_driven_attack_experiments/minitown_experiments_attack_plc2.ipynb

Lines changed: 18 additions & 18 deletions
Large diffs are not rendered by default.

Jupyter_notebooks/wadi_plot.ipynb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"cell_type": "code",
21-
"execution_count": 5,
21+
"execution_count": 2,
2222
"metadata": {},
2323
"outputs": [
2424
{
@@ -109,13 +109,6 @@
109109
"plt.subplots_adjust(top=2.00, right=3.00, hspace = subplot_hspace, wspace=subplot_wspace)\n",
110110
"plt.grid(True)"
111111
]
112-
},
113-
{
114-
"cell_type": "code",
115-
"execution_count": null,
116-
"metadata": {},
117-
"outputs": [],
118-
"source": []
119112
}
120113
],
121114
"metadata": {

Jupyter_notebooks/wntr_only_low_demand.ipynb

Lines changed: 2 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -19,112 +19,14 @@
1919
"cell_type": "code",
2020
"execution_count": 2,
2121
"metadata": {},
22-
"outputs": [
23-
{
24-
"name": "stderr",
25-
"output_type": "stream",
26-
"text": [
27-
"C:\\Users\\Azulm\\Anaconda3\\lib\\site-packages\\wntr\\epanet\\io.py:2085: UserWarning: Not all curves were used in \"../EPANET_topologies/minitown_reduced_demand_map.inp\"; added with type None, units conversion left to user\n",
28-
" warnings.warn('Not all curves were used in \"{}\"; added with type None, units conversion left to user'.format(self.wn.name))\n"
29-
]
30-
}
31-
],
32-
"source": [
33-
"# Create the network\n",
34-
"inp_file = '../EPANET_topologies/minitown_reduced_demand_map.inp'\n",
35-
"wn = wntr.network.WaterNetworkModel(inp_file)\n",
36-
"\n",
37-
"# Set option for step-by-step simulation\n",
38-
"wn.options.time.duration = 900\n",
39-
"wn.options.time.hydraulic_timestep = wn.options.time.duration\n",
40-
"wn.options.time.pattern_timestep = wn.options.time.duration*4\n",
41-
"\n",
42-
"pdd_results_list = []\n",
43-
"list_header = []\n",
44-
"\n",
45-
"node_list = list(wn.node_name_list)\n",
46-
"junction_list = []\n",
47-
"for node in node_list:\n",
48-
" if wn.get_node(node).node_type == 'Junction':\n",
49-
" junction_list.append(str(node))\n",
50-
"\n",
51-
"list_header = [\"timestamps\", \"TANK_LEVEL\", \"RESERVOIR_LEVEL\"]\n",
52-
"list_header.extend(junction_list)\n",
53-
"another_list = [\"FLOW_PUMP1\", \"FLOW_PUMP2\", \"STATUS_PUMP1\", \"STATUS_PUMP2\"]\n",
54-
"list_header.extend(another_list)\n",
55-
"\n",
56-
"pdd_results_list.append(list_header)\n",
57-
"\n",
58-
"tank = wn.get_node(\"TANK\") # WNTR TANK OBJECT\n",
59-
"pump1 = wn.get_link(\"PUMP1\") # WNTR PUMP OBJECT\n",
60-
"pump2 = wn.get_link(\"PUMP2\") # WNTR PUMP OBJECT\n",
61-
"reservoir = wn.get_node(\"R1\")\n",
62-
"\n",
63-
"condition_pump1_open = controls.ValueCondition(tank, 'level', '<', 4.0)\n",
64-
"condition_pump1_close = controls.ValueCondition(tank, 'level', '>', 6.3)\n",
65-
"\n",
66-
"condition_pump2_open = controls.ValueCondition(tank, 'level', '<', 1)\n",
67-
"condition_pump2_close = controls.ValueCondition(tank, 'level', '>', 4.5)\n",
68-
"\n",
69-
"pump1_open = controls.ControlAction(pump1, 'status', 1)\n",
70-
"pump1_close = controls.ControlAction(pump1, 'status', 0)\n",
71-
"\n",
72-
"pump2_open = controls.ControlAction(pump2, 'status', 1)\n",
73-
"pump2_close = controls.ControlAction(pump2, 'status', 0)\n",
74-
"\n",
75-
"pump1_control_open = controls.Control(condition_pump1_open, pump1_open, name='pump1control1')\n",
76-
"pump1_control_close = controls.Control(condition_pump1_close, pump1_close, name='pump1control2')\n",
77-
"\n",
78-
"pump2_control_open = controls.Control(condition_pump2_open, pump2_open, name='pump2control1')\n",
79-
"pump2_control_close = controls.Control(condition_pump2_close, pump2_close, name='pump2control2')\n",
80-
"\n",
81-
"wn.add_control('WnPump1Control1', pump1_control_open)\n",
82-
"wn.add_control('WnPump1Control2', pump1_control_close)\n",
83-
"\n",
84-
"wn.add_control('WnPump2Control1', pump2_control_open)\n",
85-
"wn.add_control('WnPump2Control2', pump2_control_close)\n",
86-
"\n",
87-
"# START STEP BY STEP SIMULATION\n",
88-
"sim_2 = wntr.sim.WNTRSimulator(wn, mode='PDD')\n",
89-
"iteration = 0\n",
90-
"while iteration <= 672:\n",
91-
" results_pdd = sim_2.run_sim(convergence_error=True)\n",
92-
" \n",
93-
" values_list = []\n",
94-
" values_list.extend([results_pdd.timestamp, tank.level, reservoir.head])\n",
95-
"\n",
96-
" for junction in junction_list:\n",
97-
" values_list.extend([wn.get_node(junction).head - wn.get_node(junction).elevation])\n",
98-
"\n",
99-
" values_list.extend([pump1.flow, pump2.flow, pump1.status, pump2.status])\n",
100-
"\n",
101-
" pdd_results_list.append(values_list)\n",
102-
" iteration += 1"
103-
]
104-
},
105-
{
106-
"cell_type": "code",
107-
"execution_count": 3,
108-
"metadata": {},
109-
"outputs": [],
110-
"source": [
111-
"with open('no_minicps_pdd_low_demand.csv', 'w', newline='\\n') as f:\n",
112-
" writer = csv.writer(f)\n",
113-
" writer.writerows(pdd_results_list)"
114-
]
115-
},
116-
{
117-
"cell_type": "code",
118-
"execution_count": 4,
119-
"metadata": {},
12022
"outputs": [],
12123
"source": [
12224
"no_minicps_data_pdd = pd.read_csv('no_minicps_pdd_low_demand.csv')"
12325
]
12426
},
12527
{
12628
"cell_type": "code",
127-
"execution_count": 6,
29+
"execution_count": 3,
12830
"metadata": {},
12931
"outputs": [
13032
{
@@ -151,7 +53,7 @@
15153
},
15254
{
15355
"cell_type": "code",
154-
"execution_count": 8,
56+
"execution_count": 4,
15557
"metadata": {},
15658
"outputs": [
15759
{

0 commit comments

Comments
 (0)