/** * Checks if all Gateways are working and executes the load balancing algorithm * * {@inheritDoc} */ @Override public void run() { System.out.println("this.loadReportsByGateway.size() " + this.loadReportsByGateway.size()); this.detectFailedGateways(); if (((System.currentTimeMillis() - this.lastLoadBalacingExecutionTime) > PoAMan.DELAY_BETWEEN_TWO_LOAD_BALANCING_EXECUTIONS_IN_MILLIS) && (this.loadReportsByGateway.size() > 1)) { List analysis = this.loadReportsAnalyzer.runAnalyzer(this.loadReportsByGateway); List privateMessageList = this.planningExecutor.RunPlanningExecutor(analysis, this.vehiclesByGateway); if (privateMessageList.size() > 0) { this.sendPrivateMessages(privateMessageList); this.lastLoadBalacingExecutionTime = System.currentTimeMillis(); } } }