-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
76 lines (70 loc) · 2.83 KB
/
setup.py
File metadata and controls
76 lines (70 loc) · 2.83 KB
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
67
68
69
70
71
72
73
74
75
76
"""
Run once to set up environment.
"""
from collections import OrderedDict
parameters = OrderedDict({
"global": {
"MissionName": {"value": "", "comment": "directory name for data produced in path generation"},
"MissionFile": {"value": "", "comment": "An absolute path to the sensing mission requirements"},
"NumberOfDrones": {"value": 4, "comment": "Number of drone operating in the system"}
},
"path_generation": {
"NumberOfPlans": {"value": 8,
"comment": "Number of plans generated by each drone in the system (only 1 selected)"},
"PathMode": {"value": "normal", "comment": "two modes: normal for visiting all possible cells, "
"and greedy for visiting just one cell"}
},
"epos": {
"EPOSstdout": {"value": False, "comment": "Show the stdout from EPOS"},
"EPOSstderr": {"value": False, "comment": "Show the stderr from EPOS"},
"NumberOfSimulations": {"value": 1, "comment": "The number of runs done by EPOS"},
"IterationsPerSimulation": 32,
"NumberOfChildren": 2,
"Shuffle": 0,
"ShuffleFile": "permuation.csv",
"NumberOfWeights": 2,
"WeightsString": "0.0,0.0",
"behaviours": "same",
"agentsBehaviourPath": "default",
"constraint": "SOFT",
"constraintPlansPath": "default",
"constraintCostsPath": "default",
"strategy": "never",
"periodically.reorganizationPeriod": 3,
"convergence.memorizationOffset": 5,
"globalCost.reductionThreshold": 0.5,
"strategy.reorganizationSeed": 0,
"globalCostFunction": {"value": "MIS",
"comment": "For drone sensing missions, this should be MIS (Sensing MISmatch). "
"It should be noted that this is a custom function"},
"scaling": "STD",
"localCostFunction": "INDEX",
},
"drone": {
"BatteryCapacity": 2700,
"BodyMass": 0.027,
"BatteryMass": 0.005,
"NumberOfRotors": 4,
"RotorDiameter": 0.03,
"ProjectedBodyArea": 0.0599,
"ProjectedBatteryArea": 0.0037,
"PowerEfficiency": 0.8,
"GroundSpeed": 6.94,
"AirSpeed": 8.5
},
"environment": {
"AirDensity": 1.225
}
})
with open("drone_sense.properties", "w") as file:
for section, section_params in parameters.items():
file.write(f"[{section}]\n")
for key, item in section_params.items():
if type(item) is dict:
if "comment" in item:
file.write(f"# {item['comment']}\n")
if "value" in item:
file.write(f"{key}={item['value']}\n")
else:
file.write(f"{key}={item}\n")
file.write("\n")