@StringSetter(SNAPSHOT_PERIOD) private void setSnapshotPeriod(String value) { setSnapshotPeriod(Time.parseTime(value)); }
@Test public void testTransimsSnapshotWriterOnQSim() { final Config config = utils.loadConfig(IOUtils.newUrl(ExamplesUtils.getTestScenarioURL("equil"), "config_plans1.xml")); config.controler().setLastIteration(2); config.controler().setWriteEventsInterval(0); config.controler().setWritePlansInterval(0); config.controler().setMobsim("qsim"); config.controler().setSnapshotFormat(Arrays.asList("transims")); config.qsim().setSnapshotPeriod(600); config.qsim().setSnapshotStyle( SnapshotStyle.equiDist ) ;; final Controler controler = new Controler(config); controler.getConfig().controler().setCreateGraphs(false); controler.getConfig().controler().setDumpDataAtEnd(false); controler.run(); assertTrue(new File(controler.getControlerIO().getIterationFilename(0, "T.veh.gz")).exists()); assertTrue(new File(controler.getControlerIO().getIterationFilename(1, "T.veh.gz")).exists()); assertTrue(new File(controler.getControlerIO().getIterationFilename(2, "T.veh.gz")).exists()); }
@Test public void testKMLSnapshotWriterOnQSim() { final Config config = utils.loadConfig(IOUtils.newUrl(ExamplesUtils.getTestScenarioURL("equil"), "config_plans1.xml")); config.controler().setLastIteration(2); config.controler().setWriteEventsInterval(0); config.controler().setWritePlansInterval(0); config.controler().setMobsim("qsim"); config.controler().setSnapshotFormat(Arrays.asList("googleearth")); config.qsim().setSnapshotPeriod(600); config.qsim().setSnapshotStyle( SnapshotStyle.equiDist ) ; final Controler controler = new Controler(config); controler.getConfig().controler().setCreateGraphs(false); controler.getConfig().controler().setDumpDataAtEnd(false); controler.run(); assertTrue(new File(controler.getControlerIO().getIterationFilename(0, "googleearth.kmz")).exists()); assertTrue(new File(controler.getControlerIO().getIterationFilename(1, "googleearth.kmz")).exists()); assertTrue(new File(controler.getControlerIO().getIterationFilename(2, "googleearth.kmz")).exists()); }
@Test public void testOneSnapshotWriterInConfig() { final Config config = utils.loadConfig(IOUtils.newUrl(ExamplesUtils.getTestScenarioURL("equil"), "config_plans1.xml")); config.controler().setLastIteration(0); config.controler().setWriteEventsInterval(0); config.controler().setWritePlansInterval(0); config.qsim().setSnapshotPeriod(10); config.qsim().setSnapshotStyle(SnapshotStyle.equiDist) ;; final Controler controler = new Controler(config); controler.getConfig().controler().setCreateGraphs(false); controler.getConfig().controler().setDumpDataAtEnd(false); controler.run(); assertTrue(new File(controler.getControlerIO().getIterationFilename(0, "T.veh.gz")).exists()); }