Skip to content
8 changes: 4 additions & 4 deletions dhalsim/network_events/synced_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def db_query(self, query, write=False, parameters=None):
"""
Execute a query on the database
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.
This is necessary because of the limited concurrency in SQLite.

:param query: The SQL query to execute in the db
Expand Down Expand Up @@ -147,7 +147,7 @@ def get_master_clock(self):
"""
Get the value of the master clock of the physical process through the database.
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.

:return: Iteration in the physical process.

Expand Down Expand Up @@ -185,7 +185,7 @@ def get_sync(self, flag):
"""
Get the sync flag of this plc.
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.

:return: False if physical process wants the plc to do a iteration, True if not.

Expand All @@ -200,7 +200,7 @@ def set_sync(self, flag):
Set this plcs sync flag in the sync table. When this is 1, the physical process
knows this plc finished the requested iteration.
On a :code:`sqlite3.OperationalError` it will retry with a max of :code:`DB_TRIES` tries.
Before it reties, it will sleep for :code:`DB_SLEEP_TIME` seconds.
Before it retries, it will sleep for :code:`DB_SLEEP_TIME` seconds.

:param flag: True for sync to 1, False for sync to 0
:type flag: bool
Expand Down
10 changes: 7 additions & 3 deletions dhalsim/parser/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pathlib import Path

import yaml
from yamlinclude import YamlIncludeConstructor
import yaml_include
from schema import Schema, Or, And, Use, Optional, SchemaError, Regex

from dhalsim.parser.input_parser import InputParser
Expand Down Expand Up @@ -626,8 +626,12 @@ def __init__(self, config_path: Path):

self.config_path = config_path.absolute()

YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader,
base_dir=config_path.absolute().parent)
#YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader,
# base_dir=config_path.absolute().parent)

yaml.add_constructor("!include",
yaml_include.Constructor(base_dir=config_path.absolute().parent),
yaml.FullLoader)

try:
self.data = self.apply_schema(self.config_path)
Expand Down
3 changes: 1 addition & 2 deletions examples/ctown_topology/ctown_config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
inp_file: ctown_map.inp
iterations: 2880
#iterations: 70
network_topology_type: complex
plcs: !include ctown_plcs.yaml

log_level: debug
simulator: epynet
demand: pdd
attacks: !include ctown_unconstrained_blackbox_concealment_mitm.yaml
#attacks: !include ctown_unconstrained_blackbox_concealment_mitm.yaml
#attacks: !include ctown_concealment_mitm_value.yaml
#attacks: !include ctown_payload_replay_conceal.yaml
#ma attacks: !include ctown_network_replay_conceal.yaml
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sudo python3 -m pip install cpppo

# MiniCPS
cd ~
git clone --depth 1 https://github.com/scy-phy/minicps.git || git -C minicps pull
git clone --depth 1 https://github.com/afmurillo/minicps.git || git -C minicps pull
cd minicps
sudo python3 -m pip install .

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
'antlr4-python3-runtime==4.13.1',
'progressbar2',
'numpy==1.24.3',
'wntr',
'wntr==1.2.0',
'pandas',
'matplotlib',
'schema',
'scapy',
'pathlib',
'testresources',
'testresources==2.0.1',
'pytest-mock',
'netaddr',
'flaky',
'pytest',
'tensorflow',
'exceptiongroup==1.2.2',
'typing-extensions==4.5.0',
'tensorflow==2.13.1',
'scikit-learn',
'keras==2.13.1',
'pytest',
'pytest-mock',
'mock'
],
extras_require={
Expand Down
Loading