Compare commits
	
		
			10 Commits
		
	
	
		
			64fcb8ed01
			...
			3237f20994
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3237f20994 | |||
|  | 6426aa2bd4 | ||
|  | 716c1090f3 | ||
|  | fdf38b46dd | ||
|  | c9937d39c2 | ||
|  | 357f6e7b11 | ||
|  | 2fdb73e32e | ||
|  | bf6417c66c | ||
|  | 5ef3d4e40a | ||
|  | 8ac4977c08 | 
							
								
								
									
										2
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| [submodule "src/protobuf"] | ||||
| 	path = src/protobuf | ||||
| 	url = git@git.vatsim-germany.org:nav/aman-com.git | ||||
| 	url = git@git.ascarion.org:vatger/aman-com.git | ||||
| 	branch = feature/protobuf | ||||
|   | ||||
							
								
								
									
										16
									
								
								aman/app.py
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								aman/app.py
									
									
									
									
									
								
							| @@ -105,6 +105,7 @@ def configuration(icao): | ||||
|     if None == airport: | ||||
|         return Response('{}', status=404, mimetype='application/json') | ||||
|  | ||||
|     # get the current runway configuration | ||||
|     config = airport.SequencingConfiguration | ||||
|     dependencies = [] | ||||
|     for dependency in config.RunwayDependencies: | ||||
| @@ -127,13 +128,26 @@ def configuration(icao): | ||||
|     for runway in runways: | ||||
|         availableRunways.append(runway.Name); | ||||
|  | ||||
|     # get all IAFs of the airport | ||||
|     iafs = [] | ||||
|     for runway in airport.Configuration.GngData.ArrivalRoutes: | ||||
|         for route in airport.Configuration.GngData.ArrivalRoutes[runway]: | ||||
|             found = False | ||||
|             for iaf in iafs: | ||||
|                 if iaf['name'] == route.Iaf.Name: | ||||
|                     found = True | ||||
|                     break | ||||
|             if False == found: | ||||
|                 iafs.append({ 'name' : route.Iaf.Name, 'lat' : route.Iaf.Coordinate[0], 'lon' : route.Iaf.Coordinate[1] }) | ||||
|  | ||||
|     dictionary = { | ||||
|         'airport' : airport.Icao, | ||||
|         'useShallShouldMay' : config.UseShallShouldMay, | ||||
|         'availableRunways' : availableRunways, | ||||
|         'activeRunways' : config.ActiveArrivalRunways, | ||||
|         'dependentRunways' : dependencies, | ||||
|         'iafColorization' : airport.Configuration.IafColorization | ||||
|         'iafColorization' : airport.Configuration.IafColorization, | ||||
|         'iafs' : iafs | ||||
|     } | ||||
|     data = json.dumps(dictionary, ensure_ascii=True, cls=RunwaySequencingEncoder) | ||||
|     return Response(data, status=200, mimetype='application/json') | ||||
|   | ||||
| @@ -115,6 +115,7 @@ class RecedingHorizonControl: | ||||
|         sequenced.PlannedTrackmiles = inbound.PlannedTrackmiles | ||||
|         sequenced.AssignmentMode = inbound.AssignmentMode | ||||
|         sequenced.ExpectedRunway = inbound.ExpectedRunway | ||||
|         sequenced.HasValidSequence = True | ||||
|  | ||||
|         # resort the inbound | ||||
|         if sequenced.PlannedArrivalTime < self.Windows[index].StartTime or sequenced.PlannedArrivalTime >= self.Windows[index].EndTime: | ||||
| @@ -174,12 +175,29 @@ class RecedingHorizonControl: | ||||
|         return runwayInbounds, iafInbounds | ||||
|  | ||||
|     def optimizationRelevantInbounds(self): | ||||
|         # no new inbounds | ||||
|         if len(self.Windows) <= self.FreezedIndex + 1: | ||||
|         if 0 == len(self.Windows): | ||||
|             return None, None | ||||
|  | ||||
|         inbounds = [] | ||||
|         earliestArrivalTime = self.Windows[self.FreezedIndex + 1].StartTime | ||||
|         if self.FreezedIndex + 1 >= len(self.Windows): | ||||
|             earliestArrivalTime = dt.utcfromtimestamp(int(time.time())).replace(tzinfo = pytz.UTC) | ||||
|             earliestArrivalTime += self.Configuration.FixedBeforeArrival | ||||
|         else: | ||||
|             earliestArrivalTime = self.Windows[self.FreezedIndex + 1].StartTime | ||||
|  | ||||
|         # check if we have a reconnect in the freezed blocks (VATSIM specific behavior) | ||||
|         for i in range(0, min(len(self.Windows), self.FreezedIndex + 1)): | ||||
|             for inbound in self.Windows[i].Inbounds: | ||||
|                 if False == inbound.HasValidSequence: | ||||
|                     inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime) | ||||
|                     inbounds.append(copy.deepcopy(inbound)) | ||||
|  | ||||
|         # no new inbounds | ||||
|         if len(self.Windows) <= self.FreezedIndex + 1: | ||||
|             if 0 == len(inbounds): | ||||
|                 return None, None | ||||
|             else: | ||||
|                 return inbounds, earliestArrivalTime | ||||
|  | ||||
|         # check the overlapping windows | ||||
|         for i in range(self.FreezedIndex + 1, len(self.Windows)): | ||||
| @@ -201,7 +219,8 @@ class RecedingHorizonControl: | ||||
|  | ||||
|         for i in range(0, len(self.Windows)): | ||||
|             for inbound in self.Windows[i].Inbounds: | ||||
|                 inbounds.append(inbound) | ||||
|                 if True == inbound.HasValidSequence: | ||||
|                     inbounds.append(inbound) | ||||
|  | ||||
|         return inbounds | ||||
|  | ||||
|   | ||||
| @@ -209,8 +209,11 @@ class Node: | ||||
|                 ttg = timedelta(seconds = timeUntilIAF.total_seconds() * ttgRatio) | ||||
|                 if (ttg.total_seconds() > ttgMax): | ||||
|                     ttg = timedelta(seconds = ttgMax) | ||||
|                 if None == self.Inbound.MaximumTimeToGain or ttg > self.Inbound.MaximumTimeToGain: | ||||
|                     self.Inbound.MaximumTimeToGain = ttg | ||||
|  | ||||
|                 ita = self.Inbound.ReportTime + flightTime | ||||
|                 earliest = ita - ttg | ||||
|                 earliest = ita - self.Inbound.MaximumTimeToGain | ||||
|  | ||||
|                 self.ArrivalCandidates[identifier.Runway.Name] = ArrivalData(star = star, ita = earliest, route = arrivalRoute, | ||||
|                                                                              trackmiles = trackmiles) | ||||
|   | ||||
| @@ -8,4 +8,4 @@ class ArrivalRoute: | ||||
|         self.Route = waypoints | ||||
|  | ||||
|     def __str__(self): | ||||
|         return 'Name: ' + self.Name + ', IAF: ' + self.Iaf.name + ', RWY: ' + self.Runway | ||||
|         return 'Name: ' + self.Name + ', IAF: ' + self.Iaf.Name + ', RWY: ' + self.Runway | ||||
| @@ -17,6 +17,7 @@ class Inbound: | ||||
|         self.EnrouteArrivalTime = None | ||||
|         self.InitialArrivalTime = None | ||||
|         self.RequestedRunway = None | ||||
|         self.MaximumTimeToGain = None | ||||
|         self.PlannedArrivalTime = None | ||||
|         self.PlannedRunway = None | ||||
|         self.PlannedStar = None | ||||
| @@ -25,6 +26,7 @@ class Inbound: | ||||
|         self.FixedSequence = False | ||||
|         self.ExpectedRunway = None | ||||
|         self.AssignmentMode = None | ||||
|         self.HasValidSequence = False | ||||
|         self.WTC = None | ||||
|  | ||||
|         # analyze the WTC | ||||
|   | ||||
		Reference in New Issue
	
	Block a user