extend the configuration

This commit is contained in:
Sven Czarnian
2021-10-12 22:28:35 +02:00
parent 2ef1e13bd6
commit 276e50daa3
3 changed files with 138 additions and 0 deletions

41
aman/config/RHC.py Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env python
from datetime import timedelta
import configparser;
import sys
class RHC():
def __init__(self, config : configparser.ConfigParser):
# latest scheduling fix in minutes
self.FixedBeforeArrival = None
# number of seconds per window
self.WindowSize = None
# number of horizon windows for optimization iteration
self.WindowOverlap = None
# distance until IAF to add an aircraft to the optimization
self.MaximumIafDistance = None
# search the required sections
for key in config:
if 'windowsize' == key:
self.WindowSize = int(config['windowsize'])
elif 'windowoverlap' == key:
self.WindowOverlap = int(config['windowoverlap'])
elif 'fixedbeforearrival' == key:
self.FixedBeforeArrival = timedelta(minutes = int(config['fixedbeforearrival']))
elif 'maximumiafdistance' == key:
self.MaximumIafDistance = int(config['maximumiafdistance'])
if self.WindowSize is None:
sys.stderr.write('No window size configuration found!')
sys.exit(-1)
if self.WindowOverlap is None:
sys.stderr.write('No window overlap configuration found!')
sys.exit(-1)
if self.FixedBeforeArrival is None:
sys.stderr.write('No fixed before IAF configuration found!')
sys.exit(-1)
if self.MaximumIafDistance is None:
sys.stderr.write('No maximum IAF distance found!')
sys.exit(-1)