increase computational performance
This commit is contained in:
@@ -10,24 +10,24 @@ class RecedingHorizonWindow:
|
||||
|
||||
def isInWindow(self, inbound : Inbound):
|
||||
for report in self.Inbounds:
|
||||
if report.Report.aircraft.callsign == inbound.Report.aircraft.callsign:
|
||||
if report.Callsign == inbound.Callsign:
|
||||
return True
|
||||
return False
|
||||
|
||||
def inbound(self, callsign : str):
|
||||
for report in self.Inbounds:
|
||||
if report.Report.aircraft.callsign == callsign:
|
||||
if report.Callsign == callsign:
|
||||
return report
|
||||
return None
|
||||
|
||||
def insert(self, inbound : Inbound):
|
||||
for i in range(0, len(self.Inbounds)):
|
||||
if self.Inbounds[i].Report.aircraft.callsign == inbound.Report.aircraft.callsign:
|
||||
if self.Inbounds[i].Callsign == inbound.Callsign:
|
||||
return
|
||||
self.Inbounds.append(inbound)
|
||||
|
||||
def remove(self, callsign : str):
|
||||
for i in range(0, len(self.Inbounds)):
|
||||
if self.Inbounds[i].Report.aircraft.callsign == callsign:
|
||||
if self.Inbounds[i].Callsign == callsign:
|
||||
self.Inbounds.pop(i)
|
||||
return
|
||||
Reference in New Issue
Block a user