Browse Source

measure the execution time

Sven Czarnian 3 years ago
parent
commit
01ce0f1bfe
1 changed files with 4 additions and 2 deletions
  1. 4 2
      aman/sys/Worker.py

+ 4 - 2
aman/sys/Worker.py

@@ -105,6 +105,8 @@ class Worker(Thread):
             # search the ACO relevant aircrafts
             relevantInbounds, earliestArrivalTime = self.RecedingHorizonControl.optimizationRelevantInbounds()
             if None != relevantInbounds:
+                start = time.process_time()
+
                 # get the last landing aircrafts per runway before the RHC stage to check for constraints
                 # this is required to handle the overlap between windows
                 preceedingInbounds = {}
@@ -113,8 +115,6 @@ class Worker(Thread):
                     if None != inbound:
                         preceedingInbounds[runway.Runway.Name] = inbound
 
-                print('Relevant inbounds: ' + str(len(relevantInbounds)))
-
                 # configure the ACO run
                 acoConfig = Configuration(earliestArrivalTime, self.sequencingConfiguration, 5 * len(relevantInbounds), 5 * len(relevantInbounds))
                 if 0 != len(preceedingInbounds):
@@ -131,6 +131,8 @@ class Worker(Thread):
                               ' dt=' + str((inbound.PlannedArrivalTime - inbound.InitialArrivalTime).total_seconds()))
                     print('Delays: FCFS=' + str(aco.FcfsDelay.total_seconds()) + ', ACO=' + str(aco.ResultDelay.total_seconds()))
 
+                # measure the exuction time of the overall optimization process
+                print('Execution time: ' + str(time.process_time() - start) + ' seconds')
             else:
                 print('No relevant inbounds found for the optimization in ' + self.Icao)