コード例 #1
0
ファイル: epsilon.py プロジェクト: juhanw/pystorms
    def __init__(self):
        # Network configuration
        self.config = yaml.load(open(load_config("epsilon"), "r"),
                                yaml.FullLoader)
        self.config["swmm_input"] = load_network(self.config["name"])
        self.config["binary"] = load_binary(self.config["binary"])

        # Dry weather TSS loading, measured at the outlet of the network
        self._performormance_threshold = 1.075  # Kg/sec

        # Create the env based on the config file
        self.env = environment(self.config,
                               ctrl=True,
                               binary=self.config["binary"])

        # Create an object for storing data
        self.data_log = {
            "performance_measure": [],
            "loading": {},
            "pollutantL": {},
            "flow": {},
            "flooding": {},
        }

        # Data logger for storing _performormance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []
コード例 #2
0
    def __init__(self):
        # Network configuration
        self.config = yaml.load(open(load_config("zeta"), "r"),
                                yaml.FullLoader)
        self.config["swmm_input"] = load_network(self.config["name"])

        # Create the environment based on the physical parameters
        self.env = environment(self.config, ctrl=True)

        self.penalty_weight = {
            "T1": 1000,
            "T2": 5000,
            "T3": 5000,
            "T4": 5000,
            "T5": 5000,
            "T6": 10000
        }

        # Create an object for storing the data points
        self.data_log = {
            "performance_measure": [],
            "simulation_time": [],
            "flow": {},
            "flooding": {},
            "depthN": {},
        }

        # Log the initial simulation time
        self.data_log["simulation_time"].append(
            self.env.sim._model.getCurrentSimulationTime())

        # Data logger for storing _performance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []
コード例 #3
0
    def __init__(self):
        # Network configuration
        self.config = yaml.load(open(load_config("delta"), "r"),
                                yaml.FullLoader)
        self.config["swmm_input"] = load_network(self.config["name"])

        self.threshold = 12.0

        self.depth_thresholds = {
            "basin_C": (5.7, 2.21, 3.8, 3.28),
            "basin_S": (6.55, 9.5),
            "basin_N1": (5.92, 2.11, 5.8, 5.2),
            "basin_N2": (6.59, 4.04, 5.04, 4.44),
            "basin_N3": (11.99, 5.28, 5.92, 5.32),
        }

        # Additional penalty definition
        self.max_penalty = 10**6

        # Create the environment based on the physical parameters
        self.env = environment(self.config, ctrl=True)

        # Create an object for storing the data points
        self.data_log = {
            "performance_measure": [],
            "depthN": {},
            "flow": {},
            "flooding": {},
        }

        # Data logger for storing _performance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []
コード例 #4
0
    def __init__(self):
        # Network configuration
        self.config = {
            "swmm_input":
            load_network("theta"),
            "states": [("P1", "depthN"), ("P2", "depthN")],
            "action_space": ["1", "2"],
            "performance_targets": [
                ("8", "flow"),
                ("P1", "flooding"),
                ("P2", "flooding"),
            ],
        }

        self.threshold = 0.5

        # Create the environment based on the physical parameters
        self.env = environment(self.config, ctrl=True)

        # Create an object for storing the data points
        self.data_log = {"performance_measure": [], "flow": {}, "flooding": {}}

        # Data logger for storing _performormance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []
コード例 #5
0
ファイル: theta.py プロジェクト: juhanw/pystorms
    def __init__(self):
        # Network configuration
        self.config = yaml.load(open(load_config("theta"), "r"),
                                yaml.FullLoader)
        self.config["swmm_input"] = load_network(self.config["name"])

        self.threshold = 0.5

        # Create the environment based on the physical parameters
        self.env = environment(self.config, ctrl=True)

        # Create an object for storing the data points
        self.data_log = {"performance_measure": [], "flow": {}, "flooding": {}}

        # Data logger for storing _performance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []
コード例 #6
0
ファイル: gamma.py プロジェクト: kLabUM/pystorms
    def __init__(self):
        # Network configuration
        self.config = yaml.load(open(load_config("gamma"), "r"), yaml.FullLoader)
        self.config["swmm_input"] = load_network(self.config["name"])

        # Common threhold for the network, can be done independently
        self._performormance_threshold = 4.0

        # Create the environment based on the physical parameters
        self.env = environment(self.config, ctrl=True)

        # Create an object for storing the data points
        self.data_log = {
            "performance_measure": [],
            "flow": {},
            "flooding": {},
            "depthN": {},
            "simulation_time": [],
        }

        # Data logger for storing _performormance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []
コード例 #7
0
    def __init__(self):
        # Network configuration
        self.config = {
            "swmm_input":
            load_network("gamma"),
            "states": [
                ("1", "depthN"),
                ("2", "depthN"),
                ("3", "depthN"),
                ("4", "depthN"),
                ("5", "depthN"),
                ("6", "depthN"),
                ("7", "depthN"),
                ("8", "depthN"),
                ("9", "depthN"),
                ("10", "depthN"),
                ("11", "depthN"),
            ],
            "action_space": [
                "O1",
                "O2",
                "O3",
                "O4",
                "O5",
                "O6",
                "O7",
                "O8",
                "O9",
                "O10",
                "O11",
            ],
            "performance_targets": [
                ("O1", "flow"),
                ("O2", "flow"),
                ("O3", "flow"),
                ("O4", "flow"),
                ("O5", "flow"),
                ("O6", "flow"),
                ("O7", "flow"),
                ("O8", "flow"),
                ("O9", "flow"),
                ("O10", "flow"),
                ("O11", "flow"),
                ("1", "flooding"),
                ("2", "flooding"),
                ("3", "flooding"),
                ("4", "flooding"),
                ("5", "flooding"),
                ("6", "flooding"),
                ("7", "flooding"),
                ("8", "flooding"),
                ("9", "flooding"),
                ("10", "flooding"),
                ("11", "flooding"),
            ],
        }

        # Common threhold for the network, can be done independently
        self._performormance_threshold = 4.0

        # Create the environment based on the physical parameters
        self.env = environment(self.config, ctrl=True)

        # Create an object for storing the data points
        self.data_log = {"performance_measure": [], "flow": {}, "flooding": {}}

        # Data logger for storing _performormance data
        for ID, attribute in self.config["performance_targets"]:
            self.data_log[attribute][ID] = []