@Override public void writeExecutedPlans(String outputFile) { final Config config = scenario.getConfig(); final String inputCRS = config.plans().getInputCRS(); final String internalCRS = config.global().getCoordinateSystem(); if ( inputCRS == null ) { new PopulationWriter(experiencedPopulation, scenario.getNetwork()).write(outputFile); } else { log.info( "re-projecting \"experienced\" population from "+internalCRS+" to "+inputCRS+" for export" ); final CoordinateTransformation transformation = TransformationFactory.getCoordinateTransformation( internalCRS, inputCRS ); new PopulationWriter(transformation, experiencedPopulation, scenario.getNetwork()).write(outputFile); } }
@Override public void notifyBeforeMobsim(final BeforeMobsimEvent event) { final boolean writingPlansAtAll = writePlansInterval > 0; final boolean regularWritePlans = writingPlansAtAll && (event.getIteration()>0 && event.getIteration() % writePlansInterval== 0); final boolean earlyIteration = event.getIteration() <= writeMoreUntilIteration ; if ( writingPlansAtAll && (regularWritePlans || earlyIteration) ) { stopwatch.beginOperation("dump all plans"); log.info("dumping plans..."); final String inputCRS = config.plans().getInputCRS(); final String internalCRS = config.global().getCoordinateSystem(); if ( inputCRS == null ) { new PopulationWriter(population, network).write(controlerIO.getIterationFilename(event.getIteration(), Controler.FILENAME_POPULATION)); } else { log.info( "re-projecting population from "+internalCRS+" back to "+inputCRS+" for export" ); final CoordinateTransformation transformation = TransformationFactory.getCoordinateTransformation( internalCRS, inputCRS ); new PopulationWriter(transformation, population, network).write(controlerIO.getIterationFilename(event.getIteration(), Controler.FILENAME_POPULATION)); } log.info("finished plans dump."); stopwatch.endOperation("dump all plans"); } }