private Scenario loadScenario() { Config config = utils.loadConfig(IOUtils.newUrl(utils.classInputResourcePath(), "config.xml")); config.network().setInputFile(IOUtils.newUrl(ExamplesUtils.getTestScenarioURL("berlin"), "network.xml.gz").toString()); config.plans().setInputFile(IOUtils.newUrl(ExamplesUtils.getTestScenarioURL("berlin"), "plans_hwh_1pct.xml.gz").toString()); config.qsim().setTimeStepSize(10.0); config.qsim().setStuckTime(100.0); config.qsim().setRemoveStuckVehicles(true); config.controler().setEventsFileFormats(EnumSet.of(EventsFileFormat.xml)); config.controler().setLastIteration(1); /* linear interpolate the into time bins aggregated travel time data to avoid artifacts at the boundaries of time bins: * e.g. a first time bin with aggregated travel time of 90 seconds and a second time bin with 45 seconds; time bin size 60; * i.e. consolidateData-method in TravelTimeCalculator will accept this difference; imagine an requested route starting 2 * seconds before the end of the first time bin, another route starts 2 seconds after the start of the second time bin; then * the second one will arrive 41 seconds earlier than the first. Depending on the algorithm, some routers will detect this, * some not (see MATSim-730), which is why we decided to test the linear interpolated travel time data here (which does not * contain this artifacts). theresa, sep'17 * */ config.travelTimeCalculator().setTravelTimeGetterType("linearinterpolation"); /* * The input plans file is not sorted. After switching from TreeMap to LinkedHashMap * to store the persons in the population, we have to sort the population manually. * cdobler, oct'11 */ Scenario scenario = ScenarioUtils.loadScenario(config); PopulationUtils.sortPersons(scenario.getPopulation()); return scenario; }
config.qsim().setFlowCapFactor(0.01); config.qsim().setStorageCapFactor(0.04); config.qsim().setRemoveStuckVehicles(false); config.qsim().setStuckTime(10.0); config.planCalcScore().setLearningRate(1.0);
config.qsim().setFlowCapFactor(0.01); config.qsim().setStorageCapFactor(0.04); config.qsim().setRemoveStuckVehicles(false); config.qsim().setStuckTime(10.0); config.planCalcScore().setLearningRate(1.0);
Scenario scenario = ScenarioUtils.createScenario(ConfigUtils.createConfig()); scenario.getConfig().qsim().setStuckTime(100); scenario.getConfig().qsim().setRemoveStuckVehicles(true); MatsimRandom.reset(4711); // yyyyyy !!!!!! Network network = (Network) scenario.getNetwork();
config.controler().setMobsim("qsim"); config.global().setNumberOfThreads(1); config.qsim().setRemoveStuckVehicles(false); config.qsim().setStuckTime(10000.0); config.qsim().setStartTime(0.0);
/*package*/ Fixture(boolean usingFastCapacityUpdate) { this.scenario = (MutableScenario) ScenarioUtils.createScenario(ConfigUtils.createConfig()); this.scenario.getConfig().qsim().setStuckTime(100); this.scenario.getConfig().qsim().setRemoveStuckVehicles(true); this.scenario.getConfig().qsim().setUsingFastCapacityUpdate(usingFastCapacityUpdate); Network network = (Network) this.scenario.getNetwork(); network.setCapacityPeriod(3600.0); Node node1 = NetworkUtils.createAndAddNode(network, Id.create("1", Node.class), new Coord(0, 0)); Node node2 = NetworkUtils.createAndAddNode(network, Id.create("2", Node.class), new Coord(1, 0)); Node node3 = NetworkUtils.createAndAddNode(network, Id.create("3", Node.class), new Coord(1001, 0)); final Node fromNode = node1; final Node toNode = node2; this.link1 = NetworkUtils.createAndAddLink(network,Id.create("1", Link.class), fromNode, toNode, 1.0, 1.0, 3600.0, 1.0 ); final Node fromNode1 = node2; final Node toNode1 = node3; this.link2 = NetworkUtils.createAndAddLink(network,Id.create("2", Link.class), fromNode1, toNode1, 10 * 7.5, 2.0 * 7.5, 3600.0, 1.0 ); EventsManager eventsManager = EventsUtils.createEventsManager(); PrepareForSimUtils.createDefaultPrepareForSim(scenario).run(); sim = new QSimBuilder(scenario.getConfig()) // .useDefaults() // .build(scenario, eventsManager); this.queueNetwork = (QNetwork) sim.getNetsimNetwork(); this.qlink1 = (QLinkImpl) this.queueNetwork.getNetsimLink(Id.create("1", Link.class)); this.qlink2 = (QLinkImpl) this.queueNetwork.getNetsimLink(Id.create("2", Link.class)); dummify(this.queueNetwork); this.basicVehicle = new VehicleImpl(Id.create("1", Vehicle.class), new VehicleTypeImpl(Id.create("defaultVehicleType", VehicleType.class))); }