-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
66 lines (57 loc) · 1.72 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import argparse
from distribution import get_distribution
from simulator import run_simulation
def main():
parser = argparse.ArgumentParser(description="Data Generation Script")
parser.add_argument(
"--distribution",
choices=["exponential", "gamma", "uniform", "constant"],
help="Type of distribution (exponential, uniform, or constant)",
)
parser.add_argument(
"--parameters",
type=float,
nargs="+",
help="Parameters for the selected distribution",
)
parser.add_argument(
"--watermark_delay",
type=float,
required=True,
help="Watermark delay in seconds (a positive scalar integer)",
)
parser.add_argument(
"--watermark_speed",
type=int,
required=True,
help="The watermark will update every watermark_speed number of records",
)
parser.add_argument(
"--input_rate",
type=int,
required=True,
help="Input rate in records per second (a positive scalar integer)",
)
parser.add_argument(
"--duration",
type=int,
required=False,
default=10,
help="The number of seconds to run the waterpark simulation for",
)
args = parser.parse_args()
print("Distribution:", args.distribution)
print("Parameters:", args.parameters)
print("Watermark Delay:", args.watermark_delay)
print("Input Rate:", args.input_rate)
distribution = get_distribution(args.distribution, args.parameters)
result = run_simulation(
distribution,
args.watermark_delay,
args.watermark_speed,
args.input_rate,
args.duration,
)
print(result)
if __name__ == "__main__":
main()