epyt-flow 0.14.2__py3-none-any.whl → 0.15.0__py3-none-any.whl
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/VERSION +1 -1
- epyt_flow/__init__.py +0 -37
- epyt_flow/data/benchmarks/battledim.py +2 -2
- epyt_flow/data/benchmarks/leakdb.py +12 -9
- epyt_flow/gym/scenario_control_env.py +32 -33
- epyt_flow/simulation/events/actuator_events.py +24 -18
- epyt_flow/simulation/events/leakages.py +59 -57
- epyt_flow/simulation/events/quality_events.py +21 -30
- epyt_flow/simulation/events/system_event.py +3 -3
- epyt_flow/simulation/scada/complex_control.py +14 -12
- epyt_flow/simulation/scada/custom_control.py +22 -21
- epyt_flow/simulation/scada/scada_data.py +107 -104
- epyt_flow/simulation/scada/simple_control.py +38 -31
- epyt_flow/simulation/scenario_simulator.py +368 -395
- epyt_flow/simulation/sensor_config.py +31 -32
- epyt_flow/topology.py +11 -10
- epyt_flow/uncertainty/model_uncertainty.py +146 -122
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0.dist-info}/METADATA +14 -19
- epyt_flow-0.15.0.dist-info/RECORD +65 -0
- epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -28
- epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -21
- epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -18
- epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -134
- epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -5578
- epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -865
- epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -131
- epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -73
- epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -193
- epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -1000
- epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -177
- epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -28
- epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -1151
- epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -1117
- epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -720
- epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -476
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -431
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -1786
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -468
- epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -810
- epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -707
- epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -864
- epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -2170
- epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -93
- epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -142
- epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -24
- epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -852
- epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -1359
- epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -685
- epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -743
- epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -694
- epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -1489
- epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -1362
- epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -871
- epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -497
- epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -874
- epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -53
- epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -27
- epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -107
- epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -28
- epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -102
- epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -42
- epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -937
- epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -39
- epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -204
- epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -24
- epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -1285
- epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -368
- epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -42
- epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -586
- epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -116
- epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -260
- epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -175
- epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -35
- epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -1504
- epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -401
- epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -791
- epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -2010
- epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -400
- epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -422
- epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -1164
- epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -551
- epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -524
- epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -56
- epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -158
- epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -34
- epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -287
- epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -39
- epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -293
- epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -35
- epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -816
- epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -29
- epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -14
- epyt_flow/EPANET/compile_linux.sh +0 -4
- epyt_flow/EPANET/compile_macos.sh +0 -4
- epyt_flow/simulation/backend/__init__.py +0 -1
- epyt_flow/simulation/backend/my_epyt.py +0 -1101
- epyt_flow-0.14.2.dist-info/RECORD +0 -142
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0.dist-info}/WHEEL +0 -0
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0.dist-info}/licenses/LICENSE +0 -0
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0.dist-info}/top_level.txt +0 -0
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
******************************************************************************
|
|
3
|
-
Project: OWA EPANET
|
|
4
|
-
Version: 2.2
|
|
5
|
-
Module: hash.c
|
|
6
|
-
Description: implementation of a simple hash table
|
|
7
|
-
Authors: see AUTHORS
|
|
8
|
-
Copyright: see AUTHORS
|
|
9
|
-
License: see LICENSE
|
|
10
|
-
Last Updated: 05/15/2019
|
|
11
|
-
******************************************************************************
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#include <stdlib.h>
|
|
15
|
-
#include <string.h>
|
|
16
|
-
#include "hash.h"
|
|
17
|
-
|
|
18
|
-
#define HASHTABLEMAXSIZE 128000
|
|
19
|
-
|
|
20
|
-
// An entry in the hash table
|
|
21
|
-
typedef struct DataEntryStruct
|
|
22
|
-
{
|
|
23
|
-
char *key;
|
|
24
|
-
int data;
|
|
25
|
-
struct DataEntryStruct *next;
|
|
26
|
-
} DataEntry;
|
|
27
|
-
|
|
28
|
-
// Hash a string to an integer
|
|
29
|
-
unsigned int gethash(char *str)
|
|
30
|
-
{
|
|
31
|
-
unsigned int hash = 5381;
|
|
32
|
-
unsigned int retHash;
|
|
33
|
-
int c;
|
|
34
|
-
while ((c = *str++))
|
|
35
|
-
{
|
|
36
|
-
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
|
|
37
|
-
}
|
|
38
|
-
retHash = hash % HASHTABLEMAXSIZE;
|
|
39
|
-
return retHash;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Produce a duplicate string
|
|
43
|
-
char *dupstr(const char *s)
|
|
44
|
-
{
|
|
45
|
-
size_t size = strlen(s) + 1;
|
|
46
|
-
char *p = malloc(size);
|
|
47
|
-
if (p) memcpy(p, s, size);
|
|
48
|
-
return p;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Create a hash table
|
|
52
|
-
HashTable *hashtable_create()
|
|
53
|
-
{
|
|
54
|
-
int i;
|
|
55
|
-
HashTable *ht = (HashTable *) calloc(HASHTABLEMAXSIZE, sizeof(HashTable));
|
|
56
|
-
if (ht != NULL)
|
|
57
|
-
{
|
|
58
|
-
for (i = 0; i < HASHTABLEMAXSIZE; i++) ht[i] = NULL;
|
|
59
|
-
}
|
|
60
|
-
return ht;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Insert an entry into the hash table
|
|
64
|
-
int hashtable_insert(HashTable *ht, char *key, int data)
|
|
65
|
-
{
|
|
66
|
-
unsigned int i = gethash(key);
|
|
67
|
-
DataEntry *entry;
|
|
68
|
-
if ( i >= HASHTABLEMAXSIZE ) return 0;
|
|
69
|
-
entry = (DataEntry *) malloc(sizeof(DataEntry));
|
|
70
|
-
if (entry == NULL) return(0);
|
|
71
|
-
entry->key = dupstr(key);
|
|
72
|
-
entry->data = data;
|
|
73
|
-
entry->next = ht[i];
|
|
74
|
-
ht[i] = entry;
|
|
75
|
-
return 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Change the hash table's data entry for a particular key
|
|
79
|
-
int hashtable_update(HashTable *ht, char *key, int new_data)
|
|
80
|
-
{
|
|
81
|
-
unsigned int i = gethash(key);
|
|
82
|
-
DataEntry *entry;
|
|
83
|
-
|
|
84
|
-
if ( i >= HASHTABLEMAXSIZE ) return NOTFOUND;
|
|
85
|
-
entry = ht[i];
|
|
86
|
-
while (entry != NULL)
|
|
87
|
-
{
|
|
88
|
-
if ( strcmp(entry->key, key) == 0 )
|
|
89
|
-
{
|
|
90
|
-
entry->data = new_data;
|
|
91
|
-
return 1;
|
|
92
|
-
}
|
|
93
|
-
entry = entry->next;
|
|
94
|
-
}
|
|
95
|
-
return NOTFOUND;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Delete an entry in the hash table
|
|
99
|
-
int hashtable_delete(HashTable *ht, char *key)
|
|
100
|
-
{
|
|
101
|
-
unsigned int i = gethash(key);
|
|
102
|
-
DataEntry *entry, *preventry;
|
|
103
|
-
|
|
104
|
-
if ( i >= HASHTABLEMAXSIZE ) return NOTFOUND;
|
|
105
|
-
|
|
106
|
-
preventry = NULL;
|
|
107
|
-
entry = ht[i];
|
|
108
|
-
while (entry != NULL)
|
|
109
|
-
{
|
|
110
|
-
if (strcmp(entry->key, key) == 0)
|
|
111
|
-
{
|
|
112
|
-
if (preventry == NULL) ht[i] = entry->next;
|
|
113
|
-
else preventry->next = entry->next;
|
|
114
|
-
free(entry->key);
|
|
115
|
-
free(entry);
|
|
116
|
-
return 1;
|
|
117
|
-
}
|
|
118
|
-
preventry = entry;
|
|
119
|
-
entry = entry->next;
|
|
120
|
-
}
|
|
121
|
-
return NOTFOUND;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Find the data for a particular key
|
|
125
|
-
int hashtable_find(HashTable *ht, char *key)
|
|
126
|
-
{
|
|
127
|
-
unsigned int i = gethash(key);
|
|
128
|
-
DataEntry *entry;
|
|
129
|
-
|
|
130
|
-
if ( i >= HASHTABLEMAXSIZE ) return NOTFOUND;
|
|
131
|
-
entry = ht[i];
|
|
132
|
-
while (entry != NULL)
|
|
133
|
-
{
|
|
134
|
-
if ( strcmp(entry->key, key) == 0 )
|
|
135
|
-
{
|
|
136
|
-
return entry->data;
|
|
137
|
-
}
|
|
138
|
-
entry = entry->next;
|
|
139
|
-
}
|
|
140
|
-
return NOTFOUND;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Find a particular key in the hash table
|
|
144
|
-
char *hashtable_findkey(HashTable *ht, char *key)
|
|
145
|
-
{
|
|
146
|
-
unsigned int i = gethash(key);
|
|
147
|
-
DataEntry *entry;
|
|
148
|
-
if ( i >= HASHTABLEMAXSIZE ) return NULL;
|
|
149
|
-
entry = ht[i];
|
|
150
|
-
while (entry != NULL)
|
|
151
|
-
{
|
|
152
|
-
if ( strcmp(entry->key, key) == 0 ) return entry->key;
|
|
153
|
-
entry = entry->next;
|
|
154
|
-
}
|
|
155
|
-
return NULL;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Delete a hash table and free all of its memory
|
|
159
|
-
void hashtable_free(HashTable *ht)
|
|
160
|
-
{
|
|
161
|
-
DataEntry *entry, *nextentry;
|
|
162
|
-
int i;
|
|
163
|
-
|
|
164
|
-
for (i = 0; i < HASHTABLEMAXSIZE; i++)
|
|
165
|
-
{
|
|
166
|
-
entry = ht[i];
|
|
167
|
-
while (entry != NULL)
|
|
168
|
-
{
|
|
169
|
-
nextentry = entry->next;
|
|
170
|
-
free(entry->key);
|
|
171
|
-
free(entry);
|
|
172
|
-
entry = nextentry;
|
|
173
|
-
}
|
|
174
|
-
ht[i] = NULL;
|
|
175
|
-
}
|
|
176
|
-
free(ht);
|
|
177
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
******************************************************************************
|
|
3
|
-
Project: OWA EPANET
|
|
4
|
-
Version: 2.2
|
|
5
|
-
Module: hash.h
|
|
6
|
-
Description: header for a simple hash table
|
|
7
|
-
Authors: see AUTHORS
|
|
8
|
-
Copyright: see AUTHORS
|
|
9
|
-
License: see LICENSE
|
|
10
|
-
Last Updated: 11/27/2018
|
|
11
|
-
******************************************************************************
|
|
12
|
-
*/
|
|
13
|
-
#ifndef HASH_H
|
|
14
|
-
#define HASH_H
|
|
15
|
-
|
|
16
|
-
#define NOTFOUND 0
|
|
17
|
-
|
|
18
|
-
typedef struct DataEntryStruct *HashTable;
|
|
19
|
-
|
|
20
|
-
HashTable *hashtable_create(void);
|
|
21
|
-
int hashtable_insert(HashTable *, char *, int);
|
|
22
|
-
int hashtable_find(HashTable *, char *);
|
|
23
|
-
char *hashtable_findkey(HashTable *, char *);
|
|
24
|
-
void hashtable_free(HashTable *);
|
|
25
|
-
int hashtable_update(HashTable *ht, char *key, int new_data);
|
|
26
|
-
int hashtable_delete(HashTable *ht, char *key);
|
|
27
|
-
|
|
28
|
-
#endif
|