epyt-flow 0.14.0__tar.gz → 0.14.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/PKG-INFO +2 -2
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/REQUIREMENTS.txt +1 -1
- epyt_flow-0.14.2/epyt_flow/VERSION +1 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/gym/scenario_control_env.py +26 -3
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/quality_events.py +6 -6
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/sensor_faults.py +24 -24
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/system_event.py +3 -3
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scada/scada_data.py +2 -2
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scenario_simulator.py +14 -11
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/topology.py +8 -1
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/uncertainty/model_uncertainty.py +292 -150
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/utils.py +66 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/visualization/visualization_utils.py +4 -2
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow.egg-info/PKG-INFO +2 -2
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow.egg-info/requires.txt +1 -1
- epyt_flow-0.14.0/epyt_flow/VERSION +0 -1
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/CITATION.cff +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/CODE_OF_CONDUCT.md +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/LICENSE +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/MANIFEST.in +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/README.md +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/compile_linux.sh +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/EPANET/compile_macos.sh +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/batadal.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/batadal_data.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/battledim.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/battledim_data.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/gecco_water_quality.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/leakdb.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/leakdb_data.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/benchmarks/water_usage.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/data/networks.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/gym/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/base_handler.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/res_manager.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scada_data/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scada_data/data_handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scada_data/export_handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scada_data/handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scenario/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scenario/control_handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scenario/event_handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scenario/handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scenario/simulation_handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/scenario/uncertainty_handlers.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/rest_api/server.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/serialization.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/backend/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/backend/my_epyt.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/actuator_events.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/event.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/leakages.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/sensor_reading_attack.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/events/sensor_reading_event.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/parallel_simulation.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scada/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scada/complex_control.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scada/custom_control.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scada/scada_data_export.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scada/simple_control.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/scenario_config.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/simulation/sensor_config.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/uncertainty/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/uncertainty/sensor_noise.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/uncertainty/uncertainties.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/uncertainty/utils.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/visualization/__init__.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow/visualization/scenario_visualizer.py +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow.egg-info/SOURCES.txt +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow.egg-info/dependency_links.txt +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/epyt_flow.egg-info/top_level.txt +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/pyproject.toml +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/setup.cfg +0 -0
- {epyt_flow-0.14.0 → epyt_flow-0.14.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: epyt-flow
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
4
4
|
Summary: EPyT-Flow -- EPANET Python Toolkit - Flow
|
|
5
5
|
Author-email: André Artelt <aartelt@techfak.uni-bielefeld.de>, "Marios S. Kyriakou" <kiriakou.marios@ucy.ac.cy>, "Stelios G. Vrachimis" <vrachimis.stelios@ucy.ac.cy>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
20
20
|
Requires-Python: >=3.9
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: epyt>=1.2.
|
|
23
|
+
Requires-Dist: epyt>=1.2.2
|
|
24
24
|
Requires-Dist: requests>=2.31.0
|
|
25
25
|
Requires-Dist: scipy>=1.11.4
|
|
26
26
|
Requires-Dist: u-msgpack-python>=2.8.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.14.2
|
|
@@ -23,6 +23,10 @@ class ScenarioControlEnv(ABC):
|
|
|
23
23
|
autoreset : `bool`, optional
|
|
24
24
|
If True, environment is automatically reset if terminated.
|
|
25
25
|
|
|
26
|
+
The default is False.
|
|
27
|
+
reapply_uncertainties_at_reset : `bool`, optional
|
|
28
|
+
If True, the uncertainties are re-applied to the original properties at each reset.
|
|
29
|
+
|
|
26
30
|
The default is False.
|
|
27
31
|
|
|
28
32
|
Attributes
|
|
@@ -36,7 +40,9 @@ class ScenarioControlEnv(ABC):
|
|
|
36
40
|
_hydraulic_scada_data : :class:`~epyt_flow.simulation.scada.scada_data.ScadaData`, protected
|
|
37
41
|
SCADA data from the hydraulic simulation -- only used if EPANET-MSX is used in the control scenario.
|
|
38
42
|
"""
|
|
39
|
-
def __init__(self, scenario_config: ScenarioConfig, autoreset: bool = False,
|
|
43
|
+
def __init__(self, scenario_config: ScenarioConfig, autoreset: bool = False,
|
|
44
|
+
reapply_uncertainties_at_reset: bool = False,
|
|
45
|
+
**kwds):
|
|
40
46
|
if not isinstance(scenario_config, ScenarioConfig):
|
|
41
47
|
raise TypeError("'scenario_config' must be an instance of " +
|
|
42
48
|
"'epyt_flow.simulation.ScenarioConfig' " +
|
|
@@ -44,12 +50,15 @@ class ScenarioControlEnv(ABC):
|
|
|
44
50
|
if not isinstance(autoreset, bool):
|
|
45
51
|
raise TypeError("'autoreset' must be an instance of 'bool' " +
|
|
46
52
|
f"but not of '{type(autoreset)}'")
|
|
53
|
+
if not isinstance(reapply_uncertainties_at_reset, bool):
|
|
54
|
+
raise TypeError("")
|
|
47
55
|
|
|
48
56
|
self._scenario_config = scenario_config
|
|
49
57
|
self._scenario_sim = None
|
|
50
58
|
self._sim_generator = None
|
|
51
59
|
self.__autoreset = autoreset
|
|
52
60
|
self._hydraulic_scada_data = None
|
|
61
|
+
self.__reapply_uncertainties_at_reset = reapply_uncertainties_at_reset
|
|
53
62
|
|
|
54
63
|
super().__init__(**kwds)
|
|
55
64
|
|
|
@@ -65,6 +74,18 @@ class ScenarioControlEnv(ABC):
|
|
|
65
74
|
"""
|
|
66
75
|
return self.__autoreset
|
|
67
76
|
|
|
77
|
+
@property
|
|
78
|
+
def reapply_uncertainties_at_reset(self) -> bool:
|
|
79
|
+
"""
|
|
80
|
+
True, if the uncertainties are re-applied to the original properties at each reset.
|
|
81
|
+
|
|
82
|
+
Returns
|
|
83
|
+
-------
|
|
84
|
+
`bool`
|
|
85
|
+
True, if the uncertainties are re-applied to the original properties at each reset.
|
|
86
|
+
"""
|
|
87
|
+
return self.__reapply_uncertainties_at_reset
|
|
88
|
+
|
|
68
89
|
def __enter__(self):
|
|
69
90
|
return self
|
|
70
91
|
|
|
@@ -117,14 +138,16 @@ class ScenarioControlEnv(ABC):
|
|
|
117
138
|
# Run hydraulic simulation first
|
|
118
139
|
hyd_export = os.path.join(get_temp_folder(), f"epytflow_env_MSX_{uuid.uuid4()}.hyd")
|
|
119
140
|
sim = self._scenario_sim.run_hydraulic_simulation
|
|
120
|
-
self._hydraulic_scada_data = sim(hyd_export=hyd_export
|
|
141
|
+
self._hydraulic_scada_data = sim(hyd_export=hyd_export,
|
|
142
|
+
reapply_uncertainties=self.__reapply_uncertainties_at_reset)
|
|
121
143
|
|
|
122
144
|
# Run advanced quality analysis (EPANET-MSX) on top of the computed hydraulics
|
|
123
145
|
gen = self._scenario_sim.run_advanced_quality_simulation_as_generator
|
|
124
146
|
self._sim_generator = gen(hyd_export, support_abort=True)
|
|
125
147
|
else:
|
|
126
148
|
gen = self._scenario_sim.run_hydraulic_simulation_as_generator
|
|
127
|
-
self._sim_generator = gen(support_abort=True
|
|
149
|
+
self._sim_generator = gen(support_abort=True,
|
|
150
|
+
reapply_uncertainties=self.__reapply_uncertainties_at_reset)
|
|
128
151
|
|
|
129
152
|
return self._next_sim_itr()
|
|
130
153
|
|
|
@@ -64,7 +64,7 @@ class SpeciesInjectionEvent(SystemEvent, JsonSerializable):
|
|
|
64
64
|
|
|
65
65
|
self.__species_id = species_id
|
|
66
66
|
self.__node_id = node_id
|
|
67
|
-
self.
|
|
67
|
+
self._profile = profile
|
|
68
68
|
self.__source_type = source_type
|
|
69
69
|
|
|
70
70
|
super().__init__(**kwds)
|
|
@@ -103,7 +103,7 @@ class SpeciesInjectionEvent(SystemEvent, JsonSerializable):
|
|
|
103
103
|
`numpy.ndarray`
|
|
104
104
|
Pattern of the injection.
|
|
105
105
|
"""
|
|
106
|
-
return deepcopy(self.
|
|
106
|
+
return deepcopy(self._profile)
|
|
107
107
|
|
|
108
108
|
@property
|
|
109
109
|
def source_type(self) -> int:
|
|
@@ -125,17 +125,17 @@ class SpeciesInjectionEvent(SystemEvent, JsonSerializable):
|
|
|
125
125
|
|
|
126
126
|
def get_attributes(self) -> dict:
|
|
127
127
|
return super().get_attributes() | {"species_id": self.__species_id,
|
|
128
|
-
"node_id": self.__node_id, "profile": self.
|
|
128
|
+
"node_id": self.__node_id, "profile": self._profile,
|
|
129
129
|
"source_type": self.__source_type}
|
|
130
130
|
|
|
131
131
|
def __eq__(self, other) -> bool:
|
|
132
132
|
return super().__eq__(other) and self.__species_id == other.species_id and \
|
|
133
|
-
self.__node_id == other.node_id and np.all(self.
|
|
133
|
+
self.__node_id == other.node_id and np.all(self._profile == other.profile) and \
|
|
134
134
|
self.__source_type == other.source_type
|
|
135
135
|
|
|
136
136
|
def __str__(self) -> str:
|
|
137
137
|
return f"{super().__str__()} species_id: {self.__species_id} " +\
|
|
138
|
-
f"node_id: {self.__node_id} profile: {self.
|
|
138
|
+
f"node_id: {self.__node_id} profile: {self._profile} source_type: {self.__source_type}"
|
|
139
139
|
|
|
140
140
|
def _get_pattern_id(self) -> str:
|
|
141
141
|
return f"{self.__species_id}_{self.__node_id}"
|
|
@@ -160,7 +160,7 @@ class SpeciesInjectionEvent(SystemEvent, JsonSerializable):
|
|
|
160
160
|
injection_time_start_idx = int(self.start_time / time_step)
|
|
161
161
|
|
|
162
162
|
injection_pattern = None
|
|
163
|
-
if len(self.
|
|
163
|
+
if len(self._profile) == injection_pattern_length:
|
|
164
164
|
injection_pattern = self.profile
|
|
165
165
|
else:
|
|
166
166
|
injection_pattern = np.tile(self.profile,
|
|
@@ -93,7 +93,7 @@ class SensorFaultConstant(SensorFault, JsonSerializable):
|
|
|
93
93
|
raise TypeError("'constant_shift' must be an instance of 'float' but no of " +
|
|
94
94
|
f"'{type(constant_shift)}'")
|
|
95
95
|
|
|
96
|
-
self.
|
|
96
|
+
self._constant_shift = constant_shift
|
|
97
97
|
|
|
98
98
|
super().__init__(**kwds)
|
|
99
99
|
|
|
@@ -107,20 +107,20 @@ class SensorFaultConstant(SensorFault, JsonSerializable):
|
|
|
107
107
|
`float`
|
|
108
108
|
Constant that is added to the sensor reading.
|
|
109
109
|
"""
|
|
110
|
-
return self.
|
|
110
|
+
return self._constant_shift
|
|
111
111
|
|
|
112
112
|
def get_attributes(self) -> dict:
|
|
113
|
-
return super().get_attributes() | {"constant_shift": self.
|
|
113
|
+
return super().get_attributes() | {"constant_shift": self._constant_shift}
|
|
114
114
|
|
|
115
115
|
def __eq__(self, other) -> bool:
|
|
116
|
-
return super().__eq__(other) and self.
|
|
116
|
+
return super().__eq__(other) and self._constant_shift == other.constant_shift
|
|
117
117
|
|
|
118
118
|
def __str__(self) -> str:
|
|
119
|
-
return f"{type(self).__name__} {super().__str__()} constant: {self.
|
|
119
|
+
return f"{type(self).__name__} {super().__str__()} constant: {self._constant_shift}"
|
|
120
120
|
|
|
121
121
|
def apply_sensor_fault(self, cur_multiplier: float, sensor_reading: float,
|
|
122
122
|
cur_time: int) -> float:
|
|
123
|
-
return sensor_reading + cur_multiplier * self.
|
|
123
|
+
return sensor_reading + cur_multiplier * self._constant_shift
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
@serializable(SENSOR_FAULT_DRIFT_ID, ".epytflow_sensorfault_drift")
|
|
@@ -134,7 +134,7 @@ class SensorFaultDrift(SensorFault, JsonSerializable):
|
|
|
134
134
|
Coefficient of the drift.
|
|
135
135
|
"""
|
|
136
136
|
def __init__(self, coef: float, **kwds):
|
|
137
|
-
self.
|
|
137
|
+
self._coef = coef
|
|
138
138
|
|
|
139
139
|
super().__init__(**kwds)
|
|
140
140
|
|
|
@@ -148,20 +148,20 @@ class SensorFaultDrift(SensorFault, JsonSerializable):
|
|
|
148
148
|
`float`
|
|
149
149
|
Coefficient of the drift.
|
|
150
150
|
"""
|
|
151
|
-
return self.
|
|
151
|
+
return self._coef
|
|
152
152
|
|
|
153
153
|
def get_attributes(self) -> dict:
|
|
154
|
-
return super().get_attributes() | {"coef": self.
|
|
154
|
+
return super().get_attributes() | {"coef": self._coef}
|
|
155
155
|
|
|
156
156
|
def __eq__(self, other) -> bool:
|
|
157
|
-
return super().__eq__(other) and self.
|
|
157
|
+
return super().__eq__(other) and self._coef == other.coef
|
|
158
158
|
|
|
159
159
|
def __str__(self) -> str:
|
|
160
|
-
return f"{type(self).__name__} {super().__str__()} coef: {self.
|
|
160
|
+
return f"{type(self).__name__} {super().__str__()} coef: {self._coef}"
|
|
161
161
|
|
|
162
162
|
def apply_sensor_fault(self, cur_multiplier: float, sensor_reading: float,
|
|
163
163
|
cur_time: int) -> float:
|
|
164
|
-
return sensor_reading + cur_multiplier * (self.
|
|
164
|
+
return sensor_reading + cur_multiplier * (self._coef * (cur_time - self.start_time))
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
@serializable(SENSOR_FAULT_GAUSSIAN_ID, ".epytflow_sensorfault_gaussian")
|
|
@@ -179,7 +179,7 @@ class SensorFaultGaussian(SensorFault, JsonSerializable):
|
|
|
179
179
|
if not isinstance(std, float) or not std > 0:
|
|
180
180
|
raise ValueError("'std' must be an instance of 'float' and be greater than 0")
|
|
181
181
|
|
|
182
|
-
self.
|
|
182
|
+
self._std = std
|
|
183
183
|
|
|
184
184
|
super().__init__(**kwds)
|
|
185
185
|
|
|
@@ -193,20 +193,20 @@ class SensorFaultGaussian(SensorFault, JsonSerializable):
|
|
|
193
193
|
`float`
|
|
194
194
|
Standard deviation of the Gaussian noise.
|
|
195
195
|
"""
|
|
196
|
-
return self.
|
|
196
|
+
return self._std
|
|
197
197
|
|
|
198
198
|
def get_attributes(self) -> dict:
|
|
199
|
-
return super().get_attributes() | {"std": self.
|
|
199
|
+
return super().get_attributes() | {"std": self._std}
|
|
200
200
|
|
|
201
201
|
def __eq__(self, other) -> bool:
|
|
202
|
-
return super().__eq__(other) and self.
|
|
202
|
+
return super().__eq__(other) and self._std == other.std
|
|
203
203
|
|
|
204
204
|
def __str__(self) -> str:
|
|
205
|
-
return f"{type(self).__name__} {super().__str__()} std: {self.
|
|
205
|
+
return f"{type(self).__name__} {super().__str__()} std: {self._std}"
|
|
206
206
|
|
|
207
207
|
def apply_sensor_fault(self, cur_multiplier: float, sensor_reading: float,
|
|
208
208
|
cur_time: int) -> float:
|
|
209
|
-
return sensor_reading + cur_multiplier * np.random.normal(loc=0, scale=self.
|
|
209
|
+
return sensor_reading + cur_multiplier * np.random.normal(loc=0, scale=self._std)
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
@serializable(SENSOR_FAULT_PERCENTAGE_ID, ".epytflow_sensorfault_percentage",)
|
|
@@ -223,7 +223,7 @@ class SensorFaultPercentage(SensorFault, JsonSerializable):
|
|
|
223
223
|
if not isinstance(coef, float) or not coef > 0:
|
|
224
224
|
raise ValueError("'coef' must be an instance of 'float' and be greater than zero.")
|
|
225
225
|
|
|
226
|
-
self.
|
|
226
|
+
self._coef = coef
|
|
227
227
|
|
|
228
228
|
super().__init__(**kwds)
|
|
229
229
|
|
|
@@ -237,20 +237,20 @@ class SensorFaultPercentage(SensorFault, JsonSerializable):
|
|
|
237
237
|
`float`
|
|
238
238
|
Coefficient (percentage) of the shift.
|
|
239
239
|
"""
|
|
240
|
-
return self.
|
|
240
|
+
return self._coef
|
|
241
241
|
|
|
242
242
|
def get_attributes(self) -> dict:
|
|
243
|
-
return super().get_attributes() | {"coef": self.
|
|
243
|
+
return super().get_attributes() | {"coef": self._coef}
|
|
244
244
|
|
|
245
245
|
def __eq__(self, other) -> bool:
|
|
246
|
-
return super().__eq__(other) and self.
|
|
246
|
+
return super().__eq__(other) and self._coef == other.coef
|
|
247
247
|
|
|
248
248
|
def __str__(self) -> str:
|
|
249
|
-
return f"{type(self).__name__} {super().__str__()} coef: {self.
|
|
249
|
+
return f"{type(self).__name__} {super().__str__()} coef: {self._coef}"
|
|
250
250
|
|
|
251
251
|
def apply_sensor_fault(self, cur_multiplier: float, sensor_reading: float,
|
|
252
252
|
cur_time: int) -> float:
|
|
253
|
-
return sensor_reading + cur_multiplier * self.
|
|
253
|
+
return sensor_reading + cur_multiplier * self._coef * sensor_reading
|
|
254
254
|
|
|
255
255
|
|
|
256
256
|
@serializable(SENSOR_FAULT_STUCKATZERO_ID, ".epytflow_sensorfault_zero")
|
|
@@ -13,7 +13,7 @@ class SystemEvent(Event):
|
|
|
13
13
|
"""
|
|
14
14
|
def __init__(self, **kwds):
|
|
15
15
|
self._epanet_api = None
|
|
16
|
-
self.
|
|
16
|
+
self._exit_called = False
|
|
17
17
|
|
|
18
18
|
super().__init__(**kwds)
|
|
19
19
|
|
|
@@ -52,9 +52,9 @@ class SystemEvent(Event):
|
|
|
52
52
|
if self.start_time <= cur_time < self.end_time:
|
|
53
53
|
self.apply(cur_time)
|
|
54
54
|
elif cur_time > self.end_time:
|
|
55
|
-
if self.
|
|
55
|
+
if self._exit_called is False:
|
|
56
56
|
self.exit(cur_time)
|
|
57
|
-
self.
|
|
57
|
+
self._exit_called = True
|
|
58
58
|
|
|
59
59
|
def reset(self) -> None:
|
|
60
60
|
"""
|
|
@@ -167,7 +167,7 @@ class ScadaData(Serializable):
|
|
|
167
167
|
raise TypeError("'sensor_readings_time' must be an instance of 'numpy.ndarray' " +
|
|
168
168
|
f"but not of '{type(sensor_readings_time)}'")
|
|
169
169
|
if warnings_code is None:
|
|
170
|
-
warnings_code = [0] * len(sensor_readings_time)
|
|
170
|
+
warnings_code = np.array([0] * len(sensor_readings_time))
|
|
171
171
|
else:
|
|
172
172
|
if not isinstance(warnings_code, np.ndarray):
|
|
173
173
|
raise TypeError("'warnings_code' must be an instance of 'numpy.ndarray' " +
|
|
@@ -1713,7 +1713,7 @@ class ScadaData(Serializable):
|
|
|
1713
1713
|
self.__sensor_reading_events = sensor_reading_events
|
|
1714
1714
|
self.__init()
|
|
1715
1715
|
|
|
1716
|
-
def extract_time_window(self, start_time: int, end_time: int):
|
|
1716
|
+
def extract_time_window(self, start_time: int, end_time: int = None):
|
|
1717
1717
|
"""
|
|
1718
1718
|
Extracts a time window of SCADA data from this SCADA data instance --
|
|
1719
1719
|
i.e. creating a new SCADA data instance containing data from the requested
|
|
@@ -1966,9 +1966,12 @@ class ScenarioSimulator():
|
|
|
1966
1966
|
self._adapt_to_network_changes()
|
|
1967
1967
|
|
|
1968
1968
|
if self._model_uncertainty is not None:
|
|
1969
|
-
if self.__uncertainties_applied is
|
|
1969
|
+
if self.__uncertainties_applied is False:
|
|
1970
1970
|
self._model_uncertainty.apply(self.epanet_api)
|
|
1971
1971
|
self.__uncertainties_applied = True
|
|
1972
|
+
elif self.__uncertainties_applied is True and reapply_uncertainties is True:
|
|
1973
|
+
self._model_uncertainty.undo(self.epanet_api)
|
|
1974
|
+
self._model_uncertainty.apply(self.epanet_api)
|
|
1972
1975
|
|
|
1973
1976
|
for event in self._system_events:
|
|
1974
1977
|
event.reset()
|
|
@@ -2006,8 +2009,8 @@ class ScenarioSimulator():
|
|
|
2006
2009
|
with the hydraulic simulation.
|
|
2007
2010
|
|
|
2008
2011
|
The default is False.
|
|
2009
|
-
reapply_uncertainties:
|
|
2010
|
-
If True, the uncertainties are re-applied.
|
|
2012
|
+
reapply_uncertainties: `bool`, optional
|
|
2013
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2011
2014
|
|
|
2012
2015
|
The default is False.
|
|
2013
2016
|
|
|
@@ -2089,8 +2092,8 @@ class ScenarioSimulator():
|
|
|
2089
2092
|
with the hydraulic simulation.
|
|
2090
2093
|
|
|
2091
2094
|
The default is False.
|
|
2092
|
-
reapply_uncertainties
|
|
2093
|
-
If True, the uncertainties are re-applied.
|
|
2095
|
+
reapply_uncertainties : `bool`, optional
|
|
2096
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2094
2097
|
|
|
2095
2098
|
The default is False.
|
|
2096
2099
|
|
|
@@ -2511,8 +2514,8 @@ class ScenarioSimulator():
|
|
|
2511
2514
|
will be stored -- this usually leads to a significant reduction in memory consumption.
|
|
2512
2515
|
|
|
2513
2516
|
The default is False.
|
|
2514
|
-
reapply_uncertainties
|
|
2515
|
-
If True, the uncertainties are re-applied.
|
|
2517
|
+
reapply_uncertainties : `bool`, optional
|
|
2518
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2516
2519
|
|
|
2517
2520
|
The default is False.
|
|
2518
2521
|
|
|
@@ -2596,8 +2599,8 @@ class ScenarioSimulator():
|
|
|
2596
2599
|
will be stored -- this usually leads to a significant reduction in memory consumption.
|
|
2597
2600
|
|
|
2598
2601
|
The default is False.
|
|
2599
|
-
reapply_uncertainties
|
|
2600
|
-
If True, the uncertainties are re-applied.
|
|
2602
|
+
reapply_uncertainties : `bool`, optional
|
|
2603
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2601
2604
|
|
|
2602
2605
|
The default is False.
|
|
2603
2606
|
|
|
@@ -2778,8 +2781,8 @@ class ScenarioSimulator():
|
|
|
2778
2781
|
will be stored -- this usually leads to a significant reduction in memory consumption.
|
|
2779
2782
|
|
|
2780
2783
|
The default is False.
|
|
2781
|
-
reapply_uncertainties:
|
|
2782
|
-
If True, the uncertainties are re-applied.
|
|
2784
|
+
reapply_uncertainties: `bool`, optional
|
|
2785
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2783
2786
|
|
|
2784
2787
|
The default is False.
|
|
2785
2788
|
|
|
@@ -500,8 +500,15 @@ class NetworkTopology(nx.Graph, JsonSerializable):
|
|
|
500
500
|
raise TypeError("Can not compare 'NetworkTopology' instance to " +
|
|
501
501
|
f"'{type(other)}' instance")
|
|
502
502
|
|
|
503
|
+
adj_matrix = self.get_adj_matrix()
|
|
504
|
+
other_adj_matrix = other.get_adj_matrix()
|
|
505
|
+
|
|
503
506
|
return super().__eq__(other) and \
|
|
504
|
-
self.
|
|
507
|
+
self.name == other.name \
|
|
508
|
+
and not np.any(adj_matrix.data != other_adj_matrix.data) \
|
|
509
|
+
and not np.any(adj_matrix.indices != other_adj_matrix.indices) \
|
|
510
|
+
and not np.any(adj_matrix.indptr != other_adj_matrix.indptr) \
|
|
511
|
+
and self.get_all_nodes() == other.get_all_nodes() \
|
|
505
512
|
and all(link_a[0] == link_b[0] and link_a[1] == link_b[1]
|
|
506
513
|
for link_a, link_b in zip(self.get_all_links(), other.get_all_links())) \
|
|
507
514
|
and self.__units == other.units \
|