@Override public void notifyIterationEnds(IterationEndsEvent event) { Iterator<GenericP0ControlHandler> hiter = handlers.iterator(); while (hiter.hasNext()) { GenericP0ControlHandler handler = hiter.next(); handler.populatelastCapacities(); // To keep track of capacities on the last day handler.printDelayStats(); } }
@Override public void notifyIterationStarts(IterationStartsEvent event) { List<NetworkChangeEvent> allchangeevents = new ArrayList<NetworkChangeEvent>(); Iterator<GenericP0ControlHandler> hiter = handlers.iterator(); while (hiter.hasNext()) { GenericP0ControlHandler handler = hiter.next(); handler.setIteration( event.getIteration()); // To run without P0 call with 0, and comment out initialisation of // events in initialise function allchangeevents.addAll(handler.getChangeEvents()); handler.initialise(); } final List<NetworkChangeEvent> events = allchangeevents; NetworkUtils.setNetworkChangeEvents(network, events); allchangeevents.removeAll(allchangeevents); }