From 01ce0f1bfe034ef5309f794d7b7afdbf8d377559 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Sun, 17 Oct 2021 17:28:20 +0200 Subject: [PATCH] measure the execution time --- aman/sys/Worker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aman/sys/Worker.py b/aman/sys/Worker.py index 7ef17af..624f674 100644 --- a/aman/sys/Worker.py +++ b/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)