diff --git a/dhalsim/network_events/synced_event.py b/dhalsim/network_events/synced_event.py index 74d4c0a4..a85d5dc5 100644 --- a/dhalsim/network_events/synced_event.py +++ b/dhalsim/network_events/synced_event.py @@ -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 @@ -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. @@ -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. @@ -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 diff --git a/dhalsim/parser/config_parser.py b/dhalsim/parser/config_parser.py index 0733c92f..d5d41a4b 100644 --- a/dhalsim/parser/config_parser.py +++ b/dhalsim/parser/config_parser.py @@ -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 @@ -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) diff --git a/examples/ctown_topology/ctown_config.yaml b/examples/ctown_topology/ctown_config.yaml index 83a825a6..b5303027 100644 --- a/examples/ctown_topology/ctown_config.yaml +++ b/examples/ctown_topology/ctown_config.yaml @@ -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 diff --git a/install.sh b/install.sh index bfd5e975..27f2fb80 100755 --- a/install.sh +++ b/install.sh @@ -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 . diff --git a/setup.py b/setup.py index 2dbd487e..83a61d67 100644 --- a/setup.py +++ b/setup.py @@ -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={