epyt-flow 0.14.2__py3-none-any.whl → 0.15.0b1__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 +367 -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/utils.py +0 -66
- epyt_flow/visualization/visualization_utils.py +2 -4
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0b1.dist-info}/METADATA +12 -18
- epyt_flow-0.15.0b1.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.0b1.dist-info}/WHEEL +0 -0
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0b1.dist-info}/licenses/LICENSE +0 -0
- {epyt_flow-0.14.2.dist-info → epyt_flow-0.15.0b1.dist-info}/top_level.txt +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
******************************************************************************
|
|
3
|
-
Project: OWA EPANET
|
|
4
|
-
Version: 2.2
|
|
5
|
-
Module: main.c
|
|
6
|
-
Description: main stub for a command line executable version of EPANET
|
|
7
|
-
Authors: see AUTHORS
|
|
8
|
-
Copyright: see AUTHORS
|
|
9
|
-
License: see LICENSE
|
|
10
|
-
Last Updated: 12/07/2018
|
|
11
|
-
******************************************************************************
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#include <stdio.h>
|
|
15
|
-
#include "epanet2.h"
|
|
16
|
-
|
|
17
|
-
void writeConsole(char *s)
|
|
18
|
-
{
|
|
19
|
-
fprintf(stdout, "\r%s", s);
|
|
20
|
-
fflush(stdout);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
int main(int argc, char *argv[])
|
|
24
|
-
/*--------------------------------------------------------------
|
|
25
|
-
** Input: argc = number of command line arguments
|
|
26
|
-
** *argv[] = array of command line arguments
|
|
27
|
-
** Output: none
|
|
28
|
-
** Purpose: main program stub for command line EPANET
|
|
29
|
-
**
|
|
30
|
-
** Command line for stand-alone operation is:
|
|
31
|
-
** progname f1 f2 f3
|
|
32
|
-
** where progname = name of executable this code was compiled to,
|
|
33
|
-
** f1 = name of input file,
|
|
34
|
-
** f2 = name of report file
|
|
35
|
-
** f3 = name of binary output file (optional).
|
|
36
|
-
**--------------------------------------------------------------
|
|
37
|
-
*/
|
|
38
|
-
{
|
|
39
|
-
char *f1,*f2,*f3;
|
|
40
|
-
char blank[] = "";
|
|
41
|
-
char errmsg[256] = "";
|
|
42
|
-
int errcode;
|
|
43
|
-
int version;
|
|
44
|
-
int major;
|
|
45
|
-
int minor;
|
|
46
|
-
int patch;
|
|
47
|
-
|
|
48
|
-
// Check for proper number of command line arguments
|
|
49
|
-
if (argc < 3)
|
|
50
|
-
{
|
|
51
|
-
printf(
|
|
52
|
-
"\nUsage:\n %s <input_filename> <report_filename> [<binary_filename>]\n",
|
|
53
|
-
argv[0]);
|
|
54
|
-
return 0;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Get version number and display in Major.Minor.Patch format
|
|
58
|
-
ENgetversion(&version);
|
|
59
|
-
major = version/10000;
|
|
60
|
-
minor = (version%10000)/100;
|
|
61
|
-
patch = version%100;
|
|
62
|
-
printf("\n... Running EPANET Version %d.%d.%d\n", major, minor, patch);
|
|
63
|
-
|
|
64
|
-
// Assign pointers to file names
|
|
65
|
-
f1 = argv[1];
|
|
66
|
-
f2 = argv[2];
|
|
67
|
-
if (argc > 3) f3 = argv[3];
|
|
68
|
-
else f3 = blank;
|
|
69
|
-
|
|
70
|
-
// Run EPANET
|
|
71
|
-
errcode = ENepanet(f1, f2, f3, &writeConsole);
|
|
72
|
-
|
|
73
|
-
// Blank out the last progress message
|
|
74
|
-
printf("\r ");
|
|
75
|
-
|
|
76
|
-
// Check for errors/warnings and report accordingly
|
|
77
|
-
if (errcode == 0)
|
|
78
|
-
{
|
|
79
|
-
printf("\n... EPANET ran successfully.\n");
|
|
80
|
-
return 0;
|
|
81
|
-
}
|
|
82
|
-
else if (errcode < 100)
|
|
83
|
-
{
|
|
84
|
-
printf("\n... EPANET ran with warnings - check the Status Report.\n");
|
|
85
|
-
return 0;
|
|
86
|
-
}
|
|
87
|
-
else
|
|
88
|
-
{
|
|
89
|
-
ENgeterror(errcode, errmsg, 255);
|
|
90
|
-
printf("\n... EPANET failed with %s.\n", errmsg);
|
|
91
|
-
return 100;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
******************************************************************************
|
|
3
|
-
Project: OWA EPANET
|
|
4
|
-
Version: 2.2
|
|
5
|
-
Module: mempool.c
|
|
6
|
-
Description: a simple fast poooled memory allocation package
|
|
7
|
-
Authors: see AUTHORS
|
|
8
|
-
Copyright: see AUTHORS
|
|
9
|
-
License: see LICENSE
|
|
10
|
-
Last Updated: 05/15/2019
|
|
11
|
-
|
|
12
|
-
This module is based code by Steve Hill in Graphics Gems III,
|
|
13
|
-
David Kirk (ed.), Academic Press, Boston, MA, 1992
|
|
14
|
-
******************************************************************************
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
#include <stdlib.h>
|
|
18
|
-
|
|
19
|
-
#include "mempool.h"
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
** ALLOC_BLOCK_SIZE - adjust this size to suit your installation - it
|
|
23
|
-
** should be reasonably large otherwise you will be mallocing a lot.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
#define ALLOC_BLOCK_SIZE 64000 /*(62*1024)*/
|
|
27
|
-
|
|
28
|
-
struct MemBlock
|
|
29
|
-
{
|
|
30
|
-
struct MemBlock *next; // Next block
|
|
31
|
-
char *block, // Start of block
|
|
32
|
-
*free, // Next free position in block
|
|
33
|
-
*end; // block + block size
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
struct Mempool
|
|
37
|
-
{
|
|
38
|
-
struct MemBlock *first;
|
|
39
|
-
struct MemBlock *current;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
static struct MemBlock* createMemBlock()
|
|
43
|
-
{
|
|
44
|
-
struct MemBlock* memBlock = malloc(sizeof(struct MemBlock));
|
|
45
|
-
if (memBlock)
|
|
46
|
-
{
|
|
47
|
-
memBlock->block = malloc(ALLOC_BLOCK_SIZE * sizeof(char));
|
|
48
|
-
if (memBlock->block == NULL)
|
|
49
|
-
{
|
|
50
|
-
free(memBlock);
|
|
51
|
-
return NULL;
|
|
52
|
-
}
|
|
53
|
-
memBlock->free = memBlock->block;
|
|
54
|
-
memBlock->next = NULL;
|
|
55
|
-
memBlock->end = memBlock->block + ALLOC_BLOCK_SIZE;
|
|
56
|
-
}
|
|
57
|
-
return memBlock;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
static void deleteMemBlock(struct MemBlock* memBlock)
|
|
62
|
-
{
|
|
63
|
-
free(memBlock->block);
|
|
64
|
-
free(memBlock);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
struct Mempool * mempool_create()
|
|
69
|
-
{
|
|
70
|
-
struct Mempool *mempool;
|
|
71
|
-
mempool = (struct Mempool *)malloc(sizeof(struct Mempool));
|
|
72
|
-
if (mempool == NULL) return NULL;
|
|
73
|
-
mempool->first = createMemBlock();
|
|
74
|
-
mempool->current = mempool->first;
|
|
75
|
-
if (mempool->first == NULL) return NULL;
|
|
76
|
-
return mempool;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
void mempool_delete(struct Mempool *mempool)
|
|
80
|
-
{
|
|
81
|
-
if (mempool == NULL) return;
|
|
82
|
-
while (mempool->first)
|
|
83
|
-
{
|
|
84
|
-
mempool->current = mempool->first->next;
|
|
85
|
-
deleteMemBlock(mempool->first);
|
|
86
|
-
mempool->first = mempool->current;
|
|
87
|
-
}
|
|
88
|
-
free(mempool);
|
|
89
|
-
mempool = NULL;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
void mempool_reset(struct Mempool *mempool)
|
|
93
|
-
{
|
|
94
|
-
mempool->current = mempool->first;
|
|
95
|
-
mempool->current->free = mempool->current->block;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
char * mempool_alloc(struct Mempool *mempool, size_t size)
|
|
100
|
-
{
|
|
101
|
-
char* ptr;
|
|
102
|
-
|
|
103
|
-
/*
|
|
104
|
-
** Align to 4 byte boundary - should be ok for most machines.
|
|
105
|
-
** Change this if your machine has weird alignment requirements.
|
|
106
|
-
*/
|
|
107
|
-
size = (size + 3) & 0xfffffffc;
|
|
108
|
-
|
|
109
|
-
if (!mempool->current) return NULL;
|
|
110
|
-
ptr = mempool->current->free;
|
|
111
|
-
mempool->current->free += size;
|
|
112
|
-
|
|
113
|
-
// Check if the current block is exhausted
|
|
114
|
-
|
|
115
|
-
if (mempool->current->free >= mempool->current->end)
|
|
116
|
-
{
|
|
117
|
-
// Is the next block already allocated?
|
|
118
|
-
|
|
119
|
-
if (mempool->current->next)
|
|
120
|
-
{
|
|
121
|
-
// re-use block
|
|
122
|
-
mempool->current->next->free = mempool->current->next->block;
|
|
123
|
-
mempool->current = mempool->current->next;
|
|
124
|
-
}
|
|
125
|
-
else
|
|
126
|
-
{
|
|
127
|
-
// extend the pool with a new block
|
|
128
|
-
mempool->current->next = createMemBlock();
|
|
129
|
-
if (!mempool->current->next) return NULL;
|
|
130
|
-
mempool->current = mempool->current->next;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// set ptr to the first location in the next block
|
|
134
|
-
|
|
135
|
-
ptr = mempool->current->free;
|
|
136
|
-
mempool->current->free += size;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Return pointer to allocated memory
|
|
140
|
-
|
|
141
|
-
return ptr;
|
|
142
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
******************************************************************************
|
|
3
|
-
Project: OWA EPANET
|
|
4
|
-
Version: 2.2
|
|
5
|
-
Module: mempool.h
|
|
6
|
-
Description: header for a simple pooled memory allocator
|
|
7
|
-
Authors: see AUTHORS
|
|
8
|
-
Copyright: see AUTHORS
|
|
9
|
-
License: see LICENSE
|
|
10
|
-
Last Updated: 11/27/2018
|
|
11
|
-
******************************************************************************
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#ifndef MEMPOOL_H
|
|
15
|
-
#define MEMPOOL_H
|
|
16
|
-
|
|
17
|
-
struct Mempool;
|
|
18
|
-
|
|
19
|
-
struct Mempool * mempool_create();
|
|
20
|
-
void mempool_delete(struct Mempool *mempool);
|
|
21
|
-
void mempool_reset(struct Mempool *mempool);
|
|
22
|
-
char * mempool_alloc(struct Mempool *mempool, size_t size);
|
|
23
|
-
|
|
24
|
-
#endif
|