diff --git a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimData.java b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimData.java index 21be4d552..fa7d6399c 100644 --- a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimData.java +++ b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimData.java @@ -12,6 +12,7 @@ import org.matsim.core.network.algorithms.TransportModeNetworkFilter; import org.matsim.core.population.PopulationUtils; import org.matsim.core.router.*; +import org.matsim.core.router.costcalculators.FreespeedTravelTimeAndDisutility; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.LeastCostPathCalculatorFactory; import org.matsim.core.router.util.TravelDisutility; @@ -32,10 +33,10 @@ public final class MatsimData { private final Properties properties; private Config config; - private Network carNetwork; - private Network ptNetwork; + private final Network carNetwork; + private final Network ptNetwork; + private final TransitSchedule schedule; - private TransitSchedule schedule; private RaptorParameters raptorParameters; private DefaultRaptorParametersForPerson parametersForPerson; private LeastCostRaptorRouteSelector routeSelector; @@ -50,10 +51,11 @@ public final class MatsimData { public MatsimData(Config config, Properties properties, ZoneConnectorManager.ZoneConnectorMethod method, - DataContainer dataContainer) { + DataContainer dataContainer, Network network, TransitSchedule schedule) { this.config = config; this.raptorParameters = RaptorUtils.createParameters(config); this.properties = properties; + this.schedule = schedule; final Collection zones = dataContainer.getGeoData().getZones().values(); switch (method) { case RANDOM: @@ -67,13 +69,27 @@ public MatsimData(Config config, Properties properties, default: throw new RuntimeException("No valid zone connector method defined!"); } + + TransportModeNetworkFilter filter = new TransportModeNetworkFilter(network); + + Set car = Sets.newHashSet(TransportMode.car); + Set pt = Sets.newHashSet(TransportMode.pt); + + Network carNetwork = NetworkUtils.createNetwork(); + filter.filter(carNetwork, car); + + Network ptNetwork = NetworkUtils.createNetwork(); + filter.filter(ptNetwork, pt); + + this.carNetwork = carNetwork; + this.ptNetwork = ptNetwork; } ZoneConnectorManager getZoneConnectorManager() { return zoneConnectorManager; } - Network getCarNetwork() { + public Network getCarNetwork() { return carNetwork; } @@ -81,25 +97,9 @@ Network getPtNetwork() { return ptNetwork; } - public void update(Network network, TransitSchedule schedule, - TravelDisutility travelDisutility, TravelTime travelTime) { + public void update(TravelDisutility travelDisutility, TravelTime travelTime) { this.travelDisutility = travelDisutility; this.travelTime = travelTime; - this.schedule = schedule; - - TransportModeNetworkFilter filter = new TransportModeNetworkFilter(network); - - Set car = Sets.newHashSet(TransportMode.car); - Set pt = Sets.newHashSet(TransportMode.pt); - - Network carNetwork = NetworkUtils.createNetwork(); - filter.filter(carNetwork, car); - - Network ptNetwork = NetworkUtils.createNetwork(); - filter.filter(ptNetwork, pt); - - this.carNetwork = carNetwork; - this.ptNetwork = ptNetwork; this.leastCostPathCalculatorFactory = new FastAStarLandmarksFactory(properties.main.numberOfThreads); @@ -118,26 +118,31 @@ public void update(Network network, TransitSchedule schedule, null); routeSelector = new LeastCostRaptorRouteSelector(); } - } MultiNodePathCalculator createMultiNodePathCalculator() { return (MultiNodePathCalculator) multiNodeFactory.createPathCalculator(carNetwork, travelDisutility, travelTime); } + MultiNodePathCalculator createFreeSpeedMultiNodePathCalculator() { + FreespeedTravelTimeAndDisutility freespeed = new FreespeedTravelTimeAndDisutility(config.planCalcScore()); + return (MultiNodePathCalculator) multiNodeFactory.createPathCalculator(carNetwork, freespeed, freespeed); + } + TripRouter createTripRouter() { final RoutingModule networkRoutingModule = DefaultRoutingModules.createPureNetworkRouter( TransportMode.car, PopulationUtils.getFactory(), carNetwork, leastCostPathCalculatorFactory.createPathCalculator(carNetwork, travelDisutility, travelTime)); - final RoutingModule teleportationRoutingModule = DefaultRoutingModules.createTeleportationRouter( - TransportMode.walk, PopulationUtils.getFactory(), config.plansCalcRoute().getOrCreateModeRoutingParams(TransportMode.walk)); final RoutingModule ptRoutingModule; - if (schedule != null) { + if (schedule != null && config.transit().isUseTransit()) { + final RoutingModule teleportationRoutingModule = DefaultRoutingModules.createTeleportationRouter( + TransportMode.walk, PopulationUtils.getFactory(), config.plansCalcRoute().getOrCreateModeRoutingParams(TransportMode.walk)); final SwissRailRaptor swissRailRaptor = createSwissRailRaptor(RaptorStaticConfig.RaptorOptimization.OneToOneRouting); ptRoutingModule = new SwissRailRaptorRoutingModule(swissRailRaptor, schedule, ptNetwork, teleportationRoutingModule); } else { - ptRoutingModule = teleportationRoutingModule; + ptRoutingModule = DefaultRoutingModules.createPseudoTransitRouter(TransportMode.pt, PopulationUtils.getFactory(), carNetwork, + leastCostPathCalculatorFactory.createPathCalculator(carNetwork, travelDisutility, travelTime), config.plansCalcRoute().getOrCreateModeRoutingParams(TransportMode.pt)); } TripRouter.Builder bd = new TripRouter.Builder(config); @@ -161,8 +166,13 @@ LeastCostPathCalculator createLeastCostPathCalculator() { return leastCostPathCalculatorFactory.createPathCalculator(carNetwork, travelDisutility, travelTime); } - SwissRailRaptorData getRaptorData(RaptorStaticConfig.RaptorOptimization optimitzaion) { - switch (optimitzaion) { + RoutingModule getTeleportationRouter(String mode) { + return DefaultRoutingModules.createTeleportationRouter( + mode, PopulationUtils.getFactory(), config.plansCalcRoute().getOrCreateModeRoutingParams(mode)); + } + + SwissRailRaptorData getRaptorData(RaptorStaticConfig.RaptorOptimization optimization) { + switch (optimization) { case OneToAllRouting: return raptorDataOneToAll; case OneToOneRouting: @@ -176,4 +186,7 @@ RaptorParameters getRaptorParameters() { return raptorParameters; } + public TransitSchedule getSchedule() { + return schedule; + } } diff --git a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimSkimCreator.java b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimSkimCreator.java index 623f61ffc..2e85eca92 100644 --- a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimSkimCreator.java +++ b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimSkimCreator.java @@ -12,11 +12,10 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.network.Node; +import org.matsim.api.core.v01.population.Leg; +import org.matsim.api.core.v01.population.PlanElement; import org.matsim.core.network.NetworkUtils; -import org.matsim.core.router.ImaginaryNode; -import org.matsim.core.router.InitialNode; -import org.matsim.core.router.MultiNodeDijkstra; -import org.matsim.core.router.MultiNodePathCalculator; +import org.matsim.core.router.*; import org.matsim.core.utils.geometry.CoordUtils; import org.matsim.facilities.ActivityFacilitiesFactory; import org.matsim.facilities.ActivityFacilitiesFactoryImpl; @@ -57,7 +56,7 @@ public IndexedDoubleMatrix2D createCarSkim(Collection zones) { ImaginaryNode aggregatedToNodes = MultiNodeDijkstra.createImaginaryNode(toNodes); - for (Zone origin : partition) { + for (Zone origin : partition) { Node originNode = NetworkUtils.getNearestNode(carNetwork, matsimData.getZoneConnectorManager().getCoordsForZone(origin).get(0)); calculator.calcLeastCostPath(originNode, aggregatedToNodes, Properties.get().transportModel.peakHour_s, null, null); for (Zone destination : zones) { @@ -162,7 +161,7 @@ public IndexedDoubleMatrix2D createPtSkim(Collection zones) { return skim; } - public IndexedDoubleMatrix2D createTeleportedSkim(TravelTimes travelTimes, String mode, Collection zones) { + public IndexedDoubleMatrix2D createTeleportedSkim(Collection zones, String mode) { final int partitionSize = (int) ((double) zones.size() / (Properties.get().main.numberOfThreads)) + 1; Iterable> partitions = Iterables.partition(zones, partitionSize); @@ -173,10 +172,72 @@ public IndexedDoubleMatrix2D createTeleportedSkim(TravelTimes travelTimes, Strin for (final List partition : partitions) { executor.addTaskToQueue(() -> { try { - TravelTimes copy = travelTimes.duplicate(); + final RoutingModule teleportationRouter = matsimData.getTeleportationRouter(mode); + for (Zone origin : partition) { + for (Zone destination : zones) { + Coord originCoord = matsimData.getZoneConnectorManager().getCoordsForZone(origin).get(0); + Coord destinationCoord = matsimData.getZoneConnectorManager().getCoordsForZone(destination).get(0); + + ActivityFacilitiesFactoryImpl activityFacilitiesFactory = new ActivityFacilitiesFactoryImpl(); + Facility fromFacility = ((ActivityFacilitiesFactory) activityFacilitiesFactory).createActivityFacility(Id.create(1, ActivityFacility.class), originCoord); + Facility toFacility = ((ActivityFacilitiesFactory) activityFacilitiesFactory).createActivityFacility(Id.create(2, ActivityFacility.class), destinationCoord); + final double peakHour_s = Properties.get().transportModel.peakHour_s; + List planElements = teleportationRouter.calcRoute(fromFacility, toFacility, peakHour_s, null); + double arrivalTime = peakHour_s; + + if (!planElements.isEmpty()) { + final Leg lastLeg = (Leg) planElements.get(planElements.size() - 1); + arrivalTime = lastLeg.getDepartureTime() + lastLeg.getTravelTime(); + } + + double time = arrivalTime - peakHour_s; + + //convert to minutes + time /= 60.; + skim.setIndexed(origin.getZoneId(), destination.getZoneId(), time); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return null; + }); + } + executor.execute(); + assignIntrazonals(5, Float.MAX_VALUE, 0.66f, skim); + return skim; + } + + public IndexedDoubleMatrix2D createFreeSpeedFactorSkim(Collection zones, double factor) { + final int partitionSize = (int) ((double) zones.size() / (Properties.get().main.numberOfThreads)) + 1; + Iterable> partitions = Iterables.partition(zones, partitionSize); + + IndexedDoubleMatrix2D skim = new IndexedDoubleMatrix2D(zones, zones); + Network carNetwork = matsimData.getCarNetwork(); + ConcurrentExecutor executor = ConcurrentExecutor.fixedPoolService(Properties.get().main.numberOfThreads); + for (final List partition : partitions) { + executor.addTaskToQueue(() -> { + try { + MultiNodePathCalculator calculator = matsimData.createFreeSpeedMultiNodePathCalculator(); + Set toNodes = new HashSet<>(); + for (Zone zone : zones) { + for (Coord coord : matsimData.getZoneConnectorManager().getCoordsForZone(zone)) { + Node originNode = NetworkUtils.getNearestNode(carNetwork, coord); + toNodes.add(new InitialNode(originNode, 0., 0.)); + } + } + + ImaginaryNode aggregatedToNodes = MultiNodeDijkstra.createImaginaryNode(toNodes); + for (Zone origin : partition) { + Node originNode = NetworkUtils.getNearestNode(carNetwork, matsimData.getZoneConnectorManager().getCoordsForZone(origin).get(0)); + calculator.calcLeastCostPath(originNode, aggregatedToNodes, Properties.get().transportModel.peakHour_s, null, null); for (Zone destination : zones) { - double travelTime = copy.getTravelTime(origin, destination, Properties.get().transportModel.peakHour_s, mode); + Node destinationNode = NetworkUtils.getNearestNode(carNetwork, matsimData.getZoneConnectorManager().getCoordsForZone(destination).get(0)); + double travelTime = calculator.constructPath(originNode, destinationNode, Properties.get().transportModel.peakHour_s).travelTime; + + //adjust by factor + travelTime *= factor; //convert to minutes travelTime /= 60.; diff --git a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTransportModel.java b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTransportModel.java index b7c46bc3e..e7dad7da4 100644 --- a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTransportModel.java +++ b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTransportModel.java @@ -20,47 +20,26 @@ import de.tum.bgu.msm.container.DataContainer; -import de.tum.bgu.msm.data.Zone; -import de.tum.bgu.msm.data.accessibility.MatsimAccessibility; -import de.tum.bgu.msm.data.household.HouseholdUtil; import de.tum.bgu.msm.data.travelTimes.SkimTravelTimes; import de.tum.bgu.msm.data.travelTimes.TravelTimes; +import de.tum.bgu.msm.matsim.accessibility.MatsimAccessibility; import de.tum.bgu.msm.models.transportModel.TransportModel; import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.properties.modules.TransportModelPropertiesModule; import org.apache.log4j.Logger; -import org.locationtech.jts.geom.Geometry; -import org.matsim.api.core.v01.Coord; -import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; -import org.matsim.api.core.v01.network.Network; -import org.matsim.api.core.v01.network.Node; -import org.matsim.contrib.accessibility.AccessibilityAttributes; -import org.matsim.contrib.accessibility.AccessibilityConfigGroup; -import org.matsim.contrib.accessibility.AccessibilityModule; import org.matsim.contrib.dvrp.trafficmonitoring.TravelTimeUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.FacilitiesConfigGroup; import org.matsim.core.controler.Controler; import org.matsim.core.controler.ControlerDefaults; import org.matsim.core.controler.OutputDirectoryHierarchy; -import org.matsim.core.network.NetworkUtils; -import org.matsim.core.router.FastAStarLandmarksFactory; -import org.matsim.core.router.TripRouterFactoryBuilderWithDefaults; import org.matsim.core.router.util.TravelDisutility; import org.matsim.core.router.util.TravelTime; import org.matsim.core.scenario.ScenarioUtils; -import org.matsim.core.utils.geometry.CoordUtils; -import org.matsim.facilities.*; -import org.matsim.pt.transitSchedule.api.TransitSchedule; -import org.opengis.feature.simple.SimpleFeature; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; -import java.util.TreeMap; /** * @author dziemke, nkuehnel @@ -74,18 +53,14 @@ public final class MatsimTransportModel implements TransportModel { private final MatsimData matsimData; private final MatsimTravelTimes internalTravelTimes; - private Scenario scenario; private final DataContainer dataContainer; - private ActivityFacilities zoneRepresentativeCoords; - private MatsimAccessibility accessibility; - private MatsimScenarioAssembler scenarioAssembler; public MatsimTransportModel(DataContainer dataContainer, Config matsimConfig, - Properties properties, MatsimAccessibility accessibility, - ZoneConnectorManager.ZoneConnectorMethod method, MatsimScenarioAssembler scenarioAssembler) { + Properties properties, MatsimScenarioAssembler scenarioAssembler, + MatsimData matsimData) { this.dataContainer = Objects.requireNonNull(dataContainer); this.initialMatsimConfig = Objects.requireNonNull(matsimConfig, "No initial matsim config provided to SiloModel class!"); @@ -96,32 +71,15 @@ public MatsimTransportModel(DataContainer dataContainer, Config matsimConfig, } else { this.internalTravelTimes = new MatsimTravelTimes(matsimConfig); } - this.matsimData = new MatsimData(matsimConfig, properties, method, dataContainer); + this.matsimData = matsimData; this.scenarioAssembler = scenarioAssembler; - this.properties = properties; - this.accessibility = accessibility; } @Override public void setup() { - scenario = ScenarioUtils.loadScenario(initialMatsimConfig); - Network network = scenario.getNetwork(); internalTravelTimes.initialize(dataContainer.getGeoData(), matsimData); - logger.warn("Finding coordinates that represent a given zone."); - zoneRepresentativeCoords = FacilitiesUtils.createActivityFacilities(); - ActivityFacilitiesFactory aff = new ActivityFacilitiesFactoryImpl(); - Map zoneMap = dataContainer.getGeoData().getZones(); - for (int zoneId : zoneMap.keySet()) { - Geometry geometry = (Geometry) zoneMap.get(zoneId).getZoneFeature().getDefaultGeometry(); - Coord centroid = CoordUtils.createCoord(geometry.getCentroid().getX(), geometry.getCentroid().getY()); - Node nearestNode = NetworkUtils.getNearestNode(network, centroid); // TODO choose road of certain category - Coord coord = CoordUtils.createCoord(nearestNode.getCoord().getX(), nearestNode.getCoord().getY()); - ActivityFacility activityFacility = aff.createActivityFacility(Id.create(zoneId, ActivityFacility.class), coord); - zoneRepresentativeCoords.addActivityFacility(activityFacility); - } - if (properties.transportModel.matsimInitialEventsFile == null) { runTransportModel(properties.main.startYear); } else { @@ -163,10 +121,6 @@ private void runTransportModel(int year) { final Controler controler = new Controler(assembledScenario); - if (accessibility != null) { - setupAccessibility(assembledScenario, controler); - } - controler.run(); logger.warn("Running MATSim transport model for year " + year + " finished."); @@ -190,61 +144,6 @@ private void finalizeConfig(Config config, int year) { config.vspExperimental().setWritingOutputEvents(true); } - private void setupAccessibility(Scenario scenario, Controler controler) { - // Opportunities - Map populationMap = HouseholdUtil.getPopulationByZoneAsMap(dataContainer); - Map, Integer> zonePopulationMap = new TreeMap<>(); - for (int zoneId : populationMap.keySet()) { - zonePopulationMap.put(Id.create(zoneId, ActivityFacility.class), populationMap.get(zoneId)); - } - final ActivityFacilities opportunities = scenario.getActivityFacilities(); - int i = 0; - for (ActivityFacility activityFacility : zoneRepresentativeCoords.getFacilities().values()) { - activityFacility.getAttributes().putAttribute(AccessibilityAttributes.WEIGHT, zonePopulationMap.get(activityFacility.getId())); - opportunities.addActivityFacility(activityFacility); - i++; - } - logger.warn(i + " facilities added as opportunities."); - - SiloMatsimUtils.determineExtentOfFacilities(zoneRepresentativeCoords); - - scenario.getConfig().facilities().setFacilitiesSource(FacilitiesConfigGroup.FacilitiesSource.setInScenario); - // End opportunities - - // Accessibility settings - AccessibilityConfigGroup acg = ConfigUtils.addOrGetModule(scenario.getConfig(), AccessibilityConfigGroup.class); - acg.setMeasuringPointsFacilities(zoneRepresentativeCoords); - // - Map, Geometry> measurePointGeometryMap = new TreeMap<>(); - Map zoneFeatureMap = new HashMap<>(); - for (Zone zone : dataContainer.getGeoData().getZones().values()) { - zoneFeatureMap.put(zone.getId(), zone.getZoneFeature()); - } - - for (Integer zoneId : zoneFeatureMap.keySet()) { - SimpleFeature feature = zoneFeatureMap.get(zoneId); - Geometry geometry = (Geometry) feature.getDefaultGeometry(); - measurePointGeometryMap.put(Id.create(zoneId, ActivityFacility.class), geometry); - } - acg.setMeasurePointGeometryProvision(AccessibilityConfigGroup.MeasurePointGeometryProvision.fromShapeFile); - acg.setMeasurePointGeometryMap(measurePointGeometryMap); - - acg.setTileSize_m(1000); // TODO This is only a dummy value here - // - acg.setAreaOfAccessibilityComputation(AccessibilityConfigGroup.AreaOfAccesssibilityComputation.fromFacilitiesObject); - acg.setUseOpportunityWeights(true); - acg.setWeightExponent(Properties.get().accessibility.alphaAuto); // TODO Need differentiation for different modes - logger.warn("Properties.get().accessibility.alphaAuto = " + Properties.get().accessibility.alphaAuto); - acg.setAccessibilityMeasureType(AccessibilityConfigGroup.AccessibilityMeasureType.rawSum); - // End accessibility settings - // Accessibility module - - AccessibilityModule module = new AccessibilityModule(); - module.addFacilityDataExchangeListener(accessibility); - controler.addOverridingModule(module); - // End accessibility module - } - /** * @param eventsFile */ @@ -252,21 +151,11 @@ private void replayFromEvents(String eventsFile) { Scenario scenario = ScenarioUtils.loadScenario(initialMatsimConfig); TravelTime travelTime = TravelTimeUtils.createTravelTimesFromEvents(scenario, eventsFile); TravelDisutility travelDisutility = ControlerDefaults.createDefaultTravelDisutilityFactory(scenario).createTravelDisutility(travelTime); - TripRouterFactoryBuilderWithDefaults builder = new TripRouterFactoryBuilderWithDefaults(); - builder.setLeastCostPathCalculatorFactory(new FastAStarLandmarksFactory(properties.main.numberOfThreads)); - builder.setTravelTime(travelTime); - builder.setTravelDisutility(travelDisutility); updateTravelTimes(travelTime, travelDisutility); } - private void updateTravelTimes(TravelTime travelTime, TravelDisutility disutility) { - Network network = scenario.getNetwork(); - TransitSchedule schedule = null; - if (scenario.getConfig().transit().isUseTransit()) { - schedule = scenario.getTransitSchedule(); - } - matsimData.update(network, schedule, disutility, travelTime); + matsimData.update(disutility, travelTime); internalTravelTimes.update(matsimData); final TravelTimes mainTravelTimes = dataContainer.getTravelTimes(); @@ -279,5 +168,4 @@ private void updateTravelTimes(TravelTime travelTime, TravelDisutility disutilit dataContainer.getGeoData().getZones().values()); } } - } diff --git a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTravelTimes.java b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTravelTimes.java index 777aaac13..50c3c2c62 100644 --- a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTravelTimes.java +++ b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/MatsimTravelTimes.java @@ -66,16 +66,8 @@ public void update(MatsimData matsimData) { private void updateSkims() { logger.info("Updating car and pt skim."); - final MatsimSkimCreator matsimSkimCreator = new MatsimSkimCreator(matsimData); - IndexedDoubleMatrix2D skimCar = matsimSkimCreator.createCarSkim(zones.values()); - skimsByMode.put(TransportMode.car, skimCar); - if(config.transit().isUseTransit()) { - IndexedDoubleMatrix2D skimPt = matsimSkimCreator.createPtSkim(zones.values()); - skimsByMode.put(TransportMode.pt, skimPt); - } else { - IndexedDoubleMatrix2D skimPt = matsimSkimCreator.createTeleportedSkim(this, TransportMode.pt, zones.values()); - skimsByMode.put(TransportMode.pt, skimPt); - } + getPeakSkim(TransportMode.car); + getPeakSkim(TransportMode.pt); } private void updateRegionalTravelTimes() { @@ -186,11 +178,14 @@ public IndexedDoubleMatrix2D getPeakSkim(String mode) { skim = matsimSkimCreator.createPtSkim(zones.values()); break; } else { - logger.warn("No schedule/ network provided for pt."); + logger.warn("No schedule/ network provided for pt. Will use freespeed factor."); + skim = matsimSkimCreator.createFreeSpeedFactorSkim(zones.values(), + config.plansCalcRoute().getModeRoutingParams().get(TransportMode.pt).getTeleportedModeFreespeedFactor()); + break; } default: logger.warn("Defaulting to teleportation."); - skim = matsimSkimCreator.createTeleportedSkim(this, mode, zones.values()); + skim = matsimSkimCreator.createTeleportedSkim(zones.values(), mode); } skimsByMode.put(mode, skim); logger.info("Obtained skim for mode " + mode); diff --git a/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/accessibility/AccessibilityModule.java b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/accessibility/AccessibilityModule.java new file mode 100644 index 000000000..d33d120ab --- /dev/null +++ b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/accessibility/AccessibilityModule.java @@ -0,0 +1,115 @@ +package de.tum.bgu.msm.matsim.accessibility; + +import de.tum.bgu.msm.container.DataContainer; +import de.tum.bgu.msm.data.Zone; +import de.tum.bgu.msm.data.household.HouseholdUtil; +import de.tum.bgu.msm.matsim.MatsimData; +import de.tum.bgu.msm.matsim.SiloMatsimUtils; +import de.tum.bgu.msm.properties.Properties; +import org.apache.log4j.Logger; +import org.locationtech.jts.geom.Geometry; +import org.matsim.api.core.v01.Coord; +import org.matsim.api.core.v01.Id; +import org.matsim.api.core.v01.Scenario; +import org.matsim.api.core.v01.network.Network; +import org.matsim.api.core.v01.network.Node; +import org.matsim.contrib.accessibility.AccessibilityAttributes; +import org.matsim.contrib.accessibility.AccessibilityConfigGroup; +import org.matsim.contrib.accessibility.interfaces.FacilityDataExchangeInterface; +import org.matsim.core.config.ConfigUtils; +import org.matsim.core.config.groups.FacilitiesConfigGroup; +import org.matsim.core.controler.Controler; +import org.matsim.core.network.NetworkUtils; +import org.matsim.core.utils.geometry.CoordUtils; +import org.matsim.facilities.*; +import org.opengis.feature.simple.SimpleFeature; + +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +public class AccessibilityModule { + + private static final Logger logger = Logger.getLogger(AccessibilityModule.class); + private final MatsimData data; + private final DataContainer dataContainer; + + private ActivityFacilities zoneRepresentativeCoords; + + public AccessibilityModule(MatsimData data, DataContainer dataContainer) { + this.data = data; + this.dataContainer = dataContainer; + } + + public void setup() { + + logger.warn("Finding coordinates that represent a given zone."); + zoneRepresentativeCoords = FacilitiesUtils.createActivityFacilities(); + ActivityFacilitiesFactory aff = new ActivityFacilitiesFactoryImpl(); + Map zoneMap = dataContainer.getGeoData().getZones(); + Network network = data.getCarNetwork(); + for (int zoneId : zoneMap.keySet()) { + Geometry geometry = (Geometry) zoneMap.get(zoneId).getZoneFeature().getDefaultGeometry(); + Coord centroid = CoordUtils.createCoord(geometry.getCentroid().getX(), geometry.getCentroid().getY()); + Node nearestNode = NetworkUtils.getNearestNode(network, centroid); // TODO choose road of certain category + Coord coord = CoordUtils.createCoord(nearestNode.getCoord().getX(), nearestNode.getCoord().getY()); + ActivityFacility activityFacility = aff.createActivityFacility(Id.create(zoneId, ActivityFacility.class), coord); + zoneRepresentativeCoords.addActivityFacility(activityFacility); + } + } + + public void prepareAccessibility(Scenario scenario, Controler controler) { + // Opportunities + Map populationMap = HouseholdUtil.getPopulationByZoneAsMap(dataContainer); + Map, Integer> zonePopulationMap = new TreeMap<>(); + for (int zoneId : populationMap.keySet()) { + zonePopulationMap.put(Id.create(zoneId, ActivityFacility.class), populationMap.get(zoneId)); + } + final ActivityFacilities opportunities = scenario.getActivityFacilities(); + int i = 0; + for (ActivityFacility activityFacility : zoneRepresentativeCoords.getFacilities().values()) { + activityFacility.getAttributes().putAttribute(AccessibilityAttributes.WEIGHT, zonePopulationMap.get(activityFacility.getId())); + opportunities.addActivityFacility(activityFacility); + i++; + } + logger.warn(i + " facilities added as opportunities."); + + SiloMatsimUtils.determineExtentOfFacilities(zoneRepresentativeCoords); + + scenario.getConfig().facilities().setFacilitiesSource(FacilitiesConfigGroup.FacilitiesSource.setInScenario); + // End opportunities + + // Accessibility settings + AccessibilityConfigGroup acg = ConfigUtils.addOrGetModule(scenario.getConfig(), AccessibilityConfigGroup.class); + acg.setMeasuringPointsFacilities(zoneRepresentativeCoords); + // + Map, Geometry> measurePointGeometryMap = new TreeMap<>(); + Map zoneFeatureMap = new HashMap<>(); + for (Zone zone : dataContainer.getGeoData().getZones().values()) { + zoneFeatureMap.put(zone.getId(), zone.getZoneFeature()); + } + + for (Integer zoneId : zoneFeatureMap.keySet()) { + SimpleFeature feature = zoneFeatureMap.get(zoneId); + Geometry geometry = (Geometry) feature.getDefaultGeometry(); + measurePointGeometryMap.put(Id.create(zoneId, ActivityFacility.class), geometry); + } + acg.setMeasurePointGeometryProvision(AccessibilityConfigGroup.MeasurePointGeometryProvision.fromShapeFile); + acg.setMeasurePointGeometryMap(measurePointGeometryMap); + + acg.setTileSize_m(1000); // TODO This is only a dummy value here + // + acg.setAreaOfAccessibilityComputation(AccessibilityConfigGroup.AreaOfAccesssibilityComputation.fromFacilitiesObject); + acg.setUseOpportunityWeights(true); + acg.setWeightExponent(Properties.get().accessibility.alphaAuto); // TODO Need differentiation for different modes + logger.warn("Properties.get().accessibility.alphaAuto = " + Properties.get().accessibility.alphaAuto); + acg.setAccessibilityMeasureType(AccessibilityConfigGroup.AccessibilityMeasureType.rawSum); + // End accessibility settings + // Accessibility module + + org.matsim.contrib.accessibility.AccessibilityModule module = new org.matsim.contrib.accessibility.AccessibilityModule(); + module.addFacilityDataExchangeListener((FacilityDataExchangeInterface) dataContainer.getAccessibility()); + controler.addOverridingModule(module); + // End accessibility module + } +} diff --git a/siloCore/src/main/java/de/tum/bgu/msm/data/accessibility/MatsimAccessibility.java b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/accessibility/MatsimAccessibility.java similarity index 97% rename from siloCore/src/main/java/de/tum/bgu/msm/data/accessibility/MatsimAccessibility.java rename to extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/accessibility/MatsimAccessibility.java index 5d13fe1ac..e2b9c54fa 100644 --- a/siloCore/src/main/java/de/tum/bgu/msm/data/accessibility/MatsimAccessibility.java +++ b/extensions/matsim2silo/src/main/java/de/tum/bgu/msm/matsim/accessibility/MatsimAccessibility.java @@ -1,9 +1,10 @@ -package de.tum.bgu.msm.data.accessibility; +package de.tum.bgu.msm.matsim.accessibility; import java.util.Collection; import java.util.HashMap; import java.util.Map; +import de.tum.bgu.msm.data.accessibility.Accessibility; import org.apache.log4j.Logger; import org.jfree.util.Log; import org.matsim.api.core.v01.Id; diff --git a/extensions/matsim2silo/src/test/java/de/tum/bgu/msm/matsim/RegionalTravelTimesTest.java b/extensions/matsim2silo/src/test/java/de/tum/bgu/msm/matsim/RegionalTravelTimesTest.java index f5601088b..6b059949f 100644 --- a/extensions/matsim2silo/src/test/java/de/tum/bgu/msm/matsim/RegionalTravelTimesTest.java +++ b/extensions/matsim2silo/src/test/java/de/tum/bgu/msm/matsim/RegionalTravelTimesTest.java @@ -67,10 +67,10 @@ public void testRegionalTravelTimesWithMatsim() { MatsimTravelTimes travelTimes = new MatsimTravelTimes(config); DefaultDataContainer dataContainer = new DefaultDataContainer(geoData, null, null, null, travelTimes, null, null, properties); - final MatsimData matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.RANDOM, dataContainer); final Network network = getNetwork(); + final MatsimData matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.RANDOM, dataContainer, network, null); - matsimData.update(network, null, new TravelDisutility() { + matsimData.update(new TravelDisutility() { @Override public double getLinkTravelDisutility(Link link, double v, Person person, Vehicle vehicle) { return link.getLength(); @@ -122,7 +122,7 @@ private Network getNetwork() { final Link link = factory.createLink(Id.createLinkId(i), network.getNodes().get(Id.createNodeId(i - 1)), network.getNodes().get(Id.createNodeId(i))); - final Link linkR = factory.createLink(Id.createLinkId(i+"r"), + final Link linkR = factory.createLink(Id.createLinkId(i + "r"), network.getNodes().get(Id.createNodeId(i)), network.getNodes().get(Id.createNodeId(i - 1))); network.addLink(link); diff --git a/siloCore/src/main/java/de/tum/bgu/msm/models/relocation/moves/MovesModelImpl.java b/siloCore/src/main/java/de/tum/bgu/msm/models/relocation/moves/MovesModelImpl.java index 56178f3ba..d627199c0 100644 --- a/siloCore/src/main/java/de/tum/bgu/msm/models/relocation/moves/MovesModelImpl.java +++ b/siloCore/src/main/java/de/tum/bgu/msm/models/relocation/moves/MovesModelImpl.java @@ -74,7 +74,7 @@ public MovesModelImpl(DataContainer dataContainer, Properties properties, MovesS @Override public void setup() { housingStrategy.setup(); - String header = new StringJoiner(",").add("hh").add("oldDdd").add("newDd").toString(); + String header = new StringJoiner(",").add("hh").add("oldDdd").add("newDd").add("oldZone").add("newZone").toString(); Path basePath = Paths.get(properties.main.baseDirectory).resolve("scenOutput").resolve(properties.main.scenarioName).resolve("siloResults/relocation"); relocationTracker = new YearByYearCsvModelTracker(basePath, "relocation", header); } @@ -137,6 +137,7 @@ public boolean handleEvent(MoveEvent event) { return false; } + final int idOldDd = household.getDwellingId(); // Step 2: Choose new dwelling int idNewDD = searchForNewDwelling(household); @@ -144,15 +145,19 @@ public boolean handleEvent(MoveEvent event) { // Step 3: Move household dataContainer.getHouseholdDataManager().saveHouseholdMemento(household); + int oldZoneId = dataContainer.getRealEstateDataManager().getDwelling(idOldDd).getZoneId(); + int newZoneId = dataContainer.getRealEstateDataManager().getDwelling(idNewDD).getZoneId(); relocationTracker.trackRecord(new StringJoiner(",") .add(String.valueOf(hhId)) - .add(String.valueOf(household.getDwellingId())) + .add(String.valueOf(idOldDd)) .add(String.valueOf(idNewDD)) + .add(String.valueOf(oldZoneId)) + .add(String.valueOf(newZoneId)) .toString()); - moveHousehold(household, household.getDwellingId(), idNewDD); + moveHousehold(household, idOldDd, idNewDD); if (hhId == SiloUtil.trackHh) { SiloUtil.trackWriter.println("Household " + hhId + " has moved to dwelling " + - household.getDwellingId()); + idOldDd); } return true; } else { diff --git a/useCases/capeTown/src/main/java/de/tum/bgu/msm/run/ModelBuilderCapeTown.java b/useCases/capeTown/src/main/java/de/tum/bgu/msm/run/ModelBuilderCapeTown.java index 7ea2341f5..1938c08e2 100644 --- a/useCases/capeTown/src/main/java/de/tum/bgu/msm/run/ModelBuilderCapeTown.java +++ b/useCases/capeTown/src/main/java/de/tum/bgu/msm/run/ModelBuilderCapeTown.java @@ -5,6 +5,7 @@ import de.tum.bgu.msm.data.dwelling.DwellingFactory; import de.tum.bgu.msm.data.household.HouseholdFactory; import de.tum.bgu.msm.data.person.PersonFactory; +import de.tum.bgu.msm.matsim.MatsimData; import de.tum.bgu.msm.matsim.MatsimTransportModel; import de.tum.bgu.msm.matsim.SimpleMatsimScenarioAssembler; import de.tum.bgu.msm.matsim.ZoneConnectorManager; @@ -56,7 +57,9 @@ import de.tum.bgu.msm.models.transportModel.TransportModel; import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class ModelBuilderCapeTown { @@ -119,11 +122,16 @@ dataContainer, properties, new DefaultMovesStrategy(), TransportModel transportModel; + switch (properties.transportModel.transportModelIdentifier) { case MATSIM: - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, - new SimpleMatsimScenarioAssembler(dataContainer, properties)); + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } + transportModel = new MatsimTransportModel(dataContainer, config, properties, + new SimpleMatsimScenarioAssembler(dataContainer, properties), matsimData); // (MatsimAccessibility) dataContainer.getAccessibility()); break; case NONE: diff --git a/useCases/kagawa/src/main/java/de/tum/bgu/msm/run/ModelBuilderTak.java b/useCases/kagawa/src/main/java/de/tum/bgu/msm/run/ModelBuilderTak.java index 2ff661185..5532eae1e 100644 --- a/useCases/kagawa/src/main/java/de/tum/bgu/msm/run/ModelBuilderTak.java +++ b/useCases/kagawa/src/main/java/de/tum/bgu/msm/run/ModelBuilderTak.java @@ -55,7 +55,9 @@ import de.tum.bgu.msm.models.transportModel.TransportModel; import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class ModelBuilderTak { public static ModelContainer getTakModels(DataContainer dataContainer, Properties properties, Config config) { @@ -115,17 +117,20 @@ dataContainer, properties, new DefaultMovesStrategy(), TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.RANDOM, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterTak()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: CommuteModeChoice simpleCommuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, simpleCommuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderTak.java b/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderTak.java index e102738d5..f7257f7bd 100644 --- a/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderTak.java +++ b/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderTak.java @@ -55,7 +55,9 @@ import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.scenarios.oneCarPolicy.OneCarPolicyCarOwnerTak; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class LongCommutePenaltyModelBuilderTak { @@ -115,17 +117,21 @@ dataContainer, properties, new DefaultMovesStrategy(), TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.RANDOM, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterTak()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: CommuteModeChoice simpleCommuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, simpleCommuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); + break; case NONE: default: diff --git a/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderTak.java b/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderTak.java index 168cc46cb..1c21bc662 100644 --- a/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderTak.java +++ b/useCases/kagawa/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderTak.java @@ -53,7 +53,9 @@ import de.tum.bgu.msm.models.transportModel.TransportModel; import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class OneCarPolicyModelBuilderTak { public static ModelContainer getTakModels(DataContainer dataContainer, Properties properties, Config config) { @@ -113,17 +115,20 @@ dataContainer, properties, new DefaultMovesStrategy(), TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.RANDOM, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterTak()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: CommuteModeChoice simpleCommuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, simpleCommuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/maryland/src/main/java/de/tum/bgu/msm/run/ModelBuilderMstm.java b/useCases/maryland/src/main/java/de/tum/bgu/msm/run/ModelBuilderMstm.java index b36b4fe57..891af8a4c 100644 --- a/useCases/maryland/src/main/java/de/tum/bgu/msm/run/ModelBuilderMstm.java +++ b/useCases/maryland/src/main/java/de/tum/bgu/msm/run/ModelBuilderMstm.java @@ -5,6 +5,7 @@ import de.tum.bgu.msm.data.dwelling.DwellingFactory; import de.tum.bgu.msm.data.household.HouseholdFactory; import de.tum.bgu.msm.data.person.PersonFactory; +import de.tum.bgu.msm.matsim.MatsimData; import de.tum.bgu.msm.matsim.MatsimTransportModel; import de.tum.bgu.msm.matsim.SimpleMatsimScenarioAssembler; import de.tum.bgu.msm.matsim.ZoneConnectorManager; @@ -53,7 +54,9 @@ import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.utils.SiloUtil; import org.apache.log4j.Logger; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class ModelBuilderMstm { @@ -124,10 +127,13 @@ public static ModelContainer getModelContainerForMstm(DataContainer dataContaine case MITO_MATSIM: logger.warn("Mito not implemented for Mstm. Defaulting to simple matsim transport model"); case MATSIM: + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.RANDOM, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } final SimpleMatsimScenarioAssembler scenarioAssembler = new SimpleMatsimScenarioAssembler(dataContainer, properties); - transportModel = new MatsimTransportModel(dataContainer, config, properties, - null, - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/dd_2002.csv b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/dd_2002.csv index 02da173d8..af04aff96 100644 --- a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/dd_2002.csv +++ b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/dd_2002.csv @@ -1,107 +1,108 @@ id,zone,type,hhID,bedrooms,quality,monthlyCost,yearBuilt,coordX,coordY -1,864,"SFA",1,3,4,787,1990,NULL,NULL -2,933,"SFA",2,3,4,787,1990,NULL,NULL -3,870,"SFA",3,3,4,787,1994,NULL,NULL -4,862,"SFA",4,3,4,787,1992,NULL,NULL -5,870,"SFA",5,3,4,787,1993,NULL,NULL -6,858,"SFA",6,3,4,787,1994,NULL,NULL -7,872,"SFA",7,3,4,787,1990,NULL,NULL -8,911,"SFA",8,3,2,787,1990,NULL,NULL -9,864,"SFA",9,3,4,787,1992,NULL,NULL -10,870,"SFA",10,3,4,787,1994,NULL,NULL -11,927,"SFA",11,3,4,787,1991,NULL,NULL -12,862,"SFA",12,3,4,787,1994,NULL,NULL -13,870,"SFA",13,3,2,787,1991,NULL,NULL -14,873,"SFA",14,3,4,787,1990,NULL,NULL -15,873,"SFA",15,3,4,787,1991,NULL,NULL -16,916,"SFA",76,3,4,787,1992,NULL,NULL -17,910,"SFA",17,3,4,787,1994,NULL,NULL -18,915,"SFA",18,3,4,787,1991,NULL,NULL -19,864,"SFA",19,3,4,787,1993,NULL,NULL -20,863,"SFA",20,3,4,787,1992,NULL,NULL -21,864,"SFA",21,3,4,787,1994,NULL,NULL -22,873,"SFA",22,3,4,787,1990,NULL,NULL -23,921,"SFA",23,3,4,787,1992,NULL,NULL -24,861,"SFA",24,3,4,787,1990,NULL,NULL -25,1072,"SFD",107,2,4,500,1936,NULL,NULL -26,1057,"SFD",103,2,4,500,1933,NULL,NULL -27,1069,"SFD",37,2,4,500,1931,NULL,NULL -28,1077,"SFD",32,2,4,500,1933,NULL,NULL -29,1059,"SFD",16,2,4,500,1935,NULL,NULL -30,1068,"SFD",-1,2,4,500,1932,NULL,NULL -31,1057,"SFD",38,2,4,500,1930,NULL,NULL -32,1078,"SFD",-1,2,4,500,1938,NULL,NULL -33,1074,"SFD",33,2,4,500,1935,NULL,NULL -34,1061,"SFD",58,2,4,500,1936,NULL,NULL +1,864,"SFA",1,3,4,707,1990,NULL,NULL +2,933,"SFA",2,3,4,707,1990,NULL,NULL +3,870,"SFA",3,3,4,707,1994,NULL,NULL +4,862,"SFA",57,3,4,707,1992,NULL,NULL +5,870,"SFA",5,3,4,707,1993,NULL,NULL +6,858,"SFA",6,3,4,707,1994,NULL,NULL +7,872,"SFA",7,3,4,707,1990,NULL,NULL +8,911,"SFA",8,3,4,707,1990,NULL,NULL +9,864,"SFA",9,3,4,707,1992,NULL,NULL +10,870,"SFA",10,3,4,707,1994,NULL,NULL +11,927,"SFA",11,3,4,707,1991,NULL,NULL +12,862,"SFA",12,3,4,707,1994,NULL,NULL +13,870,"SFA",13,3,2,707,1991,NULL,NULL +14,873,"SFA",43,3,3,707,1990,NULL,NULL +15,873,"SFA",76,3,4,707,1991,NULL,NULL +16,916,"SFA",16,3,4,707,1992,NULL,NULL +17,910,"SFA",17,3,4,707,1994,NULL,NULL +18,915,"SFA",18,3,4,707,1991,NULL,NULL +19,864,"SFA",19,3,4,707,1993,NULL,NULL +20,863,"SFA",20,3,4,707,1992,NULL,NULL +21,864,"SFA",21,3,4,707,1994,NULL,NULL +22,873,"SFA",22,3,4,707,1990,NULL,NULL +23,921,"SFA",23,3,4,707,1992,NULL,NULL +24,861,"SFA",24,3,4,707,1990,NULL,NULL +25,1072,"SFD",33,2,4,500,1936,NULL,NULL +26,1057,"SFD",26,2,4,500,1933,NULL,NULL +27,1069,"SFD",38,2,4,500,1931,NULL,NULL +28,1077,"SFD",66,2,4,500,1933,NULL,NULL +29,1059,"SFD",56,2,4,500,1935,NULL,NULL +30,1068,"SFD",4,2,4,500,1932,NULL,NULL +31,1057,"SFD",75,2,4,500,1930,NULL,NULL +32,1078,"SFD",31,2,4,500,1938,NULL,NULL +33,1074,"SFD",-1,2,2,500,1935,NULL,NULL +34,1061,"SFD",104,2,4,500,1936,NULL,NULL 35,1059,"SFD",-1,2,4,500,1939,NULL,NULL -36,1057,"SFD",78,2,4,500,1938,NULL,NULL -37,1074,"SFD",102,2,3,500,1937,NULL,NULL +36,1057,"SFD",-1,2,3,500,1938,NULL,NULL +37,1074,"SFD",28,2,3,500,1937,NULL,NULL 38,1079,"SFD",-1,2,4,500,1938,NULL,NULL -39,1055,"SFD",28,2,4,500,1934,NULL,NULL -40,1063,"SFD",40,2,4,500,1933,NULL,NULL -41,1095,"SFD",41,3,4,857,1965,NULL,NULL -42,1136,"SFD",42,3,2,857,1969,NULL,NULL -43,1135,"SFD",43,3,1,857,1965,NULL,NULL -44,1099,"SFD",44,3,2,857,1969,NULL,NULL -45,1117,"SFD",45,3,2,857,1968,NULL,NULL -46,1148,"SFD",46,3,2,857,1966,NULL,NULL -47,571,"SFD",47,4,4,1745,1997,NULL,NULL -48,585,"SFD",48,4,1,1745,1997,NULL,NULL -49,583,"SFD",49,4,4,1745,1995,NULL,NULL -50,593,"SFD",50,4,4,1745,1996,NULL,NULL -51,586,"SFD",51,4,4,1745,1995,NULL,NULL -52,589,"SFD",52,4,4,1745,1998,NULL,NULL -53,541,"SFD",53,4,4,1745,1996,NULL,NULL -54,575,"SFD",54,4,4,1745,1995,NULL,NULL -55,567,"SFD",55,4,4,1745,1998,NULL,NULL -56,541,"SFD",56,4,4,1745,1996,NULL,NULL -57,589,"SFD",57,4,3,1745,1995,NULL,NULL -58,599,"SFD",106,4,4,1745,1998,NULL,NULL -59,564,"SFD",59,4,4,1745,1997,NULL,NULL -60,565,"SFD",60,4,4,1745,1996,NULL,NULL -61,565,"SFD",61,4,4,1745,1997,NULL,NULL -62,582,"SFD",62,4,4,1745,1996,NULL,NULL -63,594,"SFD",63,4,4,1745,1996,NULL,NULL -64,571,"SFD",64,4,4,1745,1996,NULL,NULL -65,565,"SFD",65,4,4,1745,1997,NULL,NULL -66,582,"SFD",66,4,4,1745,1998,NULL,NULL -67,566,"SFD",67,4,4,1745,1996,NULL,NULL -68,1165,"SFD",68,3,4,647,1998,NULL,NULL -69,1178,"SFD",69,3,4,647,1997,NULL,NULL -70,1155,"SFD",70,3,4,647,1996,NULL,NULL -71,1163,"SFD",104,3,4,647,1998,NULL,NULL -72,1163,"SFD",72,3,4,647,1997,NULL,NULL -73,1167,"SFD",73,3,4,647,1995,NULL,NULL -74,1178,"SFD",74,3,4,647,1996,NULL,NULL -75,1141,"SFD",75,3,4,647,1998,NULL,NULL -76,1155,"SFD",31,3,4,647,1995,NULL,NULL -77,1145,"SFD",77,3,4,647,1995,NULL,NULL -78,1156,"SFD",-1,3,2,647,1998,NULL,NULL -79,1174,"SFD",71,3,4,823,1997,NULL,NULL -80,1173,"SFD",105,3,1,647,1998,NULL,NULL -81,1157,"SFD",81,3,4,647,1997,NULL,NULL -82,1155,"SFD",30,3,4,647,1998,NULL,NULL -83,1162,"SFD",83,3,4,647,1996,NULL,NULL -84,19,"MF5plus",84,1,4,159,1975,NULL,NULL -85,1,"MF5plus",-1,1,4,159,1974,NULL,NULL -86,1,"MF5plus",86,1,4,159,1977,NULL,NULL -87,24,"MF5plus",87,1,4,159,1977,NULL,NULL -88,24,"MF5plus",88,1,4,159,1974,NULL,NULL -89,23,"MF5plus",89,1,4,159,1976,NULL,NULL -90,19,"MF5plus",90,1,4,159,1971,NULL,NULL -91,1,"MF5plus",91,1,4,159,1973,NULL,NULL -92,24,"MF5plus",92,1,4,159,1975,NULL,NULL -93,19,"MF5plus",93,1,4,159,1971,NULL,NULL -94,1,"MF5plus",94,1,4,159,1976,NULL,NULL -95,21,"MF5plus",95,1,4,159,1979,NULL,NULL -96,20,"MF5plus",25,1,4,159,1972,NULL,NULL -97,20,"MF5plus",97,1,4,159,1973,NULL,NULL -98,24,"MF5plus",98,1,4,159,1975,NULL,NULL -99,19,"MF5plus",99,1,4,159,1972,NULL,NULL -100,1,"MF5plus",82,1,4,159,1973,NULL,NULL -101,581,"SFD",-1,4,4,146,2000,349254.178869233,4342224.8451820025 +39,1055,"SFD",30,2,4,500,1934,NULL,NULL +40,1063,"SFD",-1,2,4,500,1933,NULL,NULL +41,1095,"SFD",41,3,4,1089,1965,NULL,NULL +42,1136,"SFD",42,3,2,1089,1969,NULL,NULL +43,1135,"SFD",71,3,2,1089,1965,NULL,NULL +44,1099,"SFD",44,3,2,1089,1969,NULL,NULL +45,1117,"SFD",45,3,2,1089,1968,NULL,NULL +46,1148,"SFD",46,3,1,1089,1966,NULL,NULL +47,571,"SFD",47,4,4,1953,1997,NULL,NULL +48,585,"SFD",48,4,1,1953,1997,NULL,NULL +49,583,"SFD",49,4,1,1953,1995,NULL,NULL +50,593,"SFD",50,4,4,1953,1996,NULL,NULL +51,586,"SFD",51,4,4,1953,1995,NULL,NULL +52,589,"SFD",52,4,4,1953,1998,NULL,NULL +53,541,"SFD",53,4,4,1953,1996,NULL,NULL +54,575,"SFD",54,4,4,1953,1995,NULL,NULL +55,567,"SFD",55,4,4,1953,1998,NULL,NULL +56,541,"SFD",35,4,4,1953,1996,NULL,NULL +57,589,"SFD",-1,4,4,1953,1995,NULL,NULL +58,599,"SFD",58,4,4,1953,1998,NULL,NULL +59,564,"SFD",59,4,4,1953,1997,NULL,NULL +60,565,"SFD",60,4,4,1953,1996,NULL,NULL +61,565,"SFD",61,4,4,1953,1997,NULL,NULL +62,582,"SFD",62,4,4,1953,1996,NULL,NULL +63,594,"SFD",63,4,3,1953,1996,NULL,NULL +64,571,"SFD",64,4,2,1953,1996,NULL,NULL +65,565,"SFD",65,4,4,1953,1997,NULL,NULL +66,582,"SFD",103,4,4,1953,1998,NULL,NULL +67,566,"SFD",67,4,4,1953,1996,NULL,NULL +68,1165,"SFD",68,3,4,823,1998,NULL,NULL +69,1178,"SFD",69,3,4,823,1997,NULL,NULL +70,1155,"SFD",70,3,4,823,1996,NULL,NULL +71,1163,"SFD",37,3,4,823,1998,NULL,NULL +72,1163,"SFD",72,3,4,823,1997,NULL,NULL +73,1167,"SFD",73,3,4,823,1995,NULL,NULL +74,1178,"SFD",74,3,4,823,1996,NULL,NULL +75,1141,"SFD",105,3,4,823,1998,NULL,NULL +76,1155,"SFD",77,3,4,823,1995,NULL,NULL +77,1145,"SFD",106,3,1,823,1995,NULL,NULL +78,1156,"SFD",78,3,2,823,1998,NULL,NULL +79,1174,"SFD",79,3,4,823,1997,NULL,NULL +80,1173,"SFD",80,3,1,823,1998,NULL,NULL +81,1157,"SFD",81,3,4,823,1997,NULL,NULL +82,1155,"SFD",82,3,4,823,1998,NULL,NULL +83,1162,"SFD",83,3,4,823,1996,NULL,NULL +84,19,"MF5plus",84,1,4,175,1975,NULL,NULL +85,1,"MF5plus",85,1,2,175,1974,NULL,NULL +86,1,"MF5plus",86,1,4,175,1977,NULL,NULL +87,24,"MF5plus",87,1,4,175,1977,NULL,NULL +88,24,"MF5plus",88,1,4,175,1974,NULL,NULL +89,23,"MF5plus",89,1,4,175,1976,NULL,NULL +90,19,"MF5plus",90,1,4,175,1971,NULL,NULL +91,1,"MF5plus",91,1,4,175,1973,NULL,NULL +92,24,"MF5plus",92,1,4,175,1975,NULL,NULL +93,19,"MF5plus",93,1,4,175,1971,NULL,NULL +94,1,"MF5plus",94,1,4,175,1976,NULL,NULL +95,21,"MF5plus",95,1,4,175,1979,NULL,NULL +96,20,"MF5plus",102,1,4,175,1972,NULL,NULL +97,20,"MF5plus",97,1,4,175,1973,NULL,NULL +98,24,"MF5plus",98,1,4,175,1975,NULL,NULL +99,19,"MF5plus",99,1,4,175,1972,NULL,NULL +100,1,"MF5plus",14,1,4,175,1973,NULL,NULL +101,581,"SFD",34,4,4,163,2000,349254.178869233,4342224.8451820025 102,952,"SFD",36,2,4,42,2000,312823.33660929714,4379709.753289761 -103,1131,"SFD",34,3,4,59,2000,430602.002077716,4333371.6379696755 -104,901,"SFA",101,3,4,182,2000,352211.27639046154,4310062.653957178 -105,22,"MF5plus",79,1,4,149,2000,354093.31970647647,4352459.27429112 -106,933,"SFA",80,3,4,165,2001,345338.36372289906,4284833.465730167 +103,1131,"SFD",32,3,4,75,2000,430602.002077716,4333371.6379696755 +104,901,"SFA",101,3,4,163,2000,352211.27639046154,4310062.653957178 +105,22,"MF5plus",15,1,4,164,2000,354093.31970647647,4352459.27429112 +106,552,"SFD",40,4,4,148,2001,327842.9521277998,4343698.807452295 +107,1177,"SFD",25,3,4,68,2001,467096.6143924326,4209961.675897924 diff --git a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/hh_2002.csv b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/hh_2002.csv index ab7ef9f7a..e93d573f2 100644 --- a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/hh_2002.csv +++ b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/hh_2002.csv @@ -2,7 +2,7 @@ id,dwelling,hhSize,autos 1,1,2,2 2,2,2,3 3,3,2,2 -4,4,2,1 +4,30,2,1 5,5,2,1 6,6,2,1 7,7,2,2 @@ -12,9 +12,9 @@ id,dwelling,hhSize,autos 11,11,2,2 12,12,2,3 13,13,2,2 -14,14,2,1 -15,15,2,2 -16,29,2,2 +14,100,2,1 +15,105,2,2 +16,16,2,2 17,17,2,2 18,18,2,2 19,19,2,2 @@ -23,24 +23,26 @@ id,dwelling,hhSize,autos 22,22,2,2 23,23,2,2 24,24,2,3 -25,96,1,1 -28,39,1,1 -30,82,1,1 -31,76,1,1 -32,28,1,2 -33,33,1,1 -34,103,1,1 +25,107,1,1 +26,26,1,0 +28,37,1,1 +30,39,1,1 +31,32,1,1 +32,103,1,2 +33,25,1,1 +34,101,1,1 +35,56,1,1 36,102,1,1 -37,27,1,1 -38,31,1,0 -40,40,1,1 +37,71,1,1 +38,27,1,0 +40,106,1,1 41,41,3,2 42,42,3,3 -43,43,3,2 +43,14,3,2 44,44,3,2 45,45,3,3 46,46,3,2 -47,47,4,3 +47,47,3,3 48,48,4,3 49,49,4,3 50,50,4,2 @@ -49,9 +51,9 @@ id,dwelling,hhSize,autos 53,53,4,2 54,54,4,2 55,55,4,2 -56,56,4,2 -57,57,4,2 -58,34,4,2 +56,29,4,2 +57,4,4,2 +58,58,4,2 59,59,4,2 60,60,4,2 61,61,4,2 @@ -59,25 +61,26 @@ id,dwelling,hhSize,autos 63,63,4,2 64,64,4,2 65,65,4,2 -66,66,4,1 -67,67,4,2 -68,68,3,2 +66,28,4,1 +67,67,5,2 +68,68,4,2 69,69,4,3 70,70,4,1 -71,79,5,2 +71,43,5,2 72,72,4,3 -73,73,4,3 -74,74,3,3 -75,75,4,3 -76,16,5,2 -77,77,4,2 -78,36,3,2 -79,105,4,1 -80,106,5,2 +73,73,3,3 +74,74,4,3 +75,31,4,3 +76,15,5,2 +77,76,4,2 +78,78,4,2 +79,79,4,1 +80,80,4,2 81,81,3,2 -82,100,4,3 +82,82,4,3 83,83,4,3 84,84,1,1 +85,85,1,2 86,86,1,0 87,87,1,1 88,88,1,0 @@ -92,9 +95,8 @@ id,dwelling,hhSize,autos 98,98,1,0 99,99,1,0 101,104,1,0 -102,37,1,0 -103,26,1,1 -104,71,4,3 -105,80,1,0 -106,58,1,0 -107,25,1,0 +102,96,1,0 +103,66,1,1 +104,34,4,3 +105,75,1,0 +106,77,1,0 diff --git a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/pp_2002.csv b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/pp_2002.csv index 35cb34a70..0ced60c2d 100644 --- a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/pp_2002.csv +++ b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimMultiYearTest/testMainMultiYear/pp_2002.csv @@ -1,249 +1,252 @@ id,hhid,age,gender,relationShip,occupation,driversLicense,workplace,income -1,1,42,2,"single",1,true,2020433,17386 -2,1,46,2,"single",2,false,-1,9987 -3,2,42,2,"single",2,false,-1,4091 +1,1,42,2,"single",1,true,2020433,17862 +2,1,46,2,"single",2,false,-1,8274 +3,2,42,2,"single",2,false,-1,0 4,2,46,2,"single",1,false,3756274,25960 -5,3,42,2,"single",2,false,-1,8434 -6,3,46,2,"single",2,false,-1,11190 -7,4,42,2,"single",2,false,-1,4400 -8,4,46,2,"single",2,true,-1,11700 -9,5,42,2,"single",1,true,1386256,14680 -10,5,46,2,"single",2,true,-1,15637 -11,6,42,2,"single",2,false,-1,5782 +5,3,42,2,"single",2,false,-1,6676 +6,3,46,2,"single",2,false,-1,16329 +7,4,42,2,"single",2,true,-1,11432 +8,4,46,2,"single",2,false,-1,8274 +9,5,42,2,"single",1,true,1386256,12776 +10,5,46,2,"single",2,false,-1,10498 +11,6,42,2,"single",2,false,-1,4024 12,6,46,2,"single",2,false,-1,12903 -13,7,42,2,"single",2,false,-1,8352 -14,7,46,2,"single",1,false,4021443,20914 -15,8,42,2,"single",2,false,-1,7540 +13,7,42,2,"single",2,true,-1,8352 +14,7,46,2,"single",1,false,4021443,23437 +15,8,42,2,"single",2,false,-1,5782 16,8,46,2,"single",1,false,3157029,23437 -17,9,42,2,"single",2,false,-1,5916 -18,9,46,2,"single",1,true,1276155,20914 +17,9,42,2,"single",2,true,-1,2400 +18,9,46,2,"single",1,false,1276155,20914 19,10,42,2,"single",2,false,-1,6158 -20,10,46,2,"single",2,false,-1,8274 -21,11,42,2,"single",2,false,-1,4039 +20,10,46,2,"single",2,false,-1,9987 +21,11,42,2,"single",2,false,-1,4918 22,11,46,2,"single",2,true,-1,6561 -23,12,42,2,"single",2,false,-1,1454 +23,12,42,2,"single",2,false,-1,4970 24,12,46,2,"single",2,false,-1,8274 -25,13,42,2,"single",2,true,-1,3212 -26,13,46,2,"single",2,false,-1,1638 -27,14,42,2,"single",2,true,-1,1521 -28,14,46,2,"single",2,true,-1,11190 -29,15,42,2,"single",2,false,-1,0 -30,15,46,2,"single",2,true,-1,9771 -31,16,42,2,"single",2,false,-1,1387 -32,16,46,2,"single",1,false,2069882,23437 -33,17,42,2,"single",1,false,2935942,18338 -34,17,46,2,"single",2,false,-1,14616 -35,18,42,2,"single",2,false,-1,7540 -36,18,46,2,"single",1,false,3297380,23437 -37,19,42,2,"single",1,false,4350275,13891 +25,13,42,2,"single",2,true,-1,0 +26,13,46,2,"single",2,true,-1,5064 +27,14,42,2,"single",2,true,-1,2400 +28,14,46,2,"single",2,true,-1,14616 +29,15,42,2,"single",2,false,-1,6728 +30,15,46,2,"single",2,true,-1,11484 +31,16,42,2,"single",2,false,-1,3145 +32,16,46,2,"single",1,false,2069882,20914 +33,17,42,2,"single",1,false,2935942,14054 +34,17,46,2,"single",2,false,-1,12903 +35,18,42,2,"single",2,false,-1,4024 +36,18,46,2,"single",1,true,3297380,25960 +37,19,42,2,"single",1,false,4350275,14367 38,19,46,2,"single",2,false,-1,9987 -39,20,42,2,"single",2,true,-1,1454 -40,20,46,2,"single",2,false,-1,8274 -41,21,42,2,"single",2,false,-1,8419 +39,20,42,2,"single",2,false,-1,3212 +40,20,46,2,"single",2,false,-1,6561 +41,21,42,2,"single",2,false,-1,4024 42,21,46,2,"single",2,false,-1,8274 43,22,42,2,"single",2,false,-1,2400 -44,22,46,2,"single",2,false,-1,8274 -45,23,42,2,"single",2,true,-1,7607 +44,22,46,2,"single",2,false,-1,6561 +45,23,42,2,"single",2,true,-1,575 46,23,46,2,"single",2,false,-1,8274 -47,24,42,2,"single",2,false,-1,1920 +47,24,42,2,"single",2,false,-1,8952 48,24,46,2,"single",2,false,-1,11190 -49,25,88,2,"single",0,false,-1,1798 -52,28,88,2,"single",0,false,-1,4178 -54,30,88,2,"single",0,false,-1,7680 -55,31,88,2,"single",0,false,-1,5464 -56,32,88,2,"single",0,false,-1,7680 -57,33,88,2,"single",0,false,-1,4903 -58,34,88,2,"single",0,false,-1,1716 -60,36,88,2,"single",0,false,-1,3850 -61,37,88,2,"single",0,false,-1,7078 -62,38,88,2,"single",0,false,-1,4178 -64,40,88,2,"single",0,false,-1,7762 -65,41,52,1,"married",2,false,-1,8485 +49,25,88,2,"single",0,false,-1,912 +50,26,88,2,"single",0,false,-1,3755 +52,28,88,2,"single",0,false,-1,0 +54,30,88,2,"single",0,false,-1,7608 +55,31,88,2,"single",0,false,-1,3812 +56,32,88,2,"single",0,false,-1,6044 +57,33,88,2,"single",0,false,-1,4879 +58,34,88,2,"single",0,false,-1,3144 +59,35,88,2,"single",0,false,-1,3087 +60,36,88,2,"single",0,false,-1,9954 +61,37,88,2,"single",0,false,-1,1580 +62,38,88,2,"single",0,false,-1,1026 +64,40,88,2,"single",0,false,-1,2248 +65,41,52,1,"married",2,false,-1,5909 66,41,51,2,"married",0,true,-1,0 -67,41,18,1,"child",0,false,-1,0 -68,42,52,1,"married",2,false,-1,8485 -69,42,51,2,"married",0,false,-1,712 +67,41,18,1,"child",0,true,-1,0 +68,42,52,1,"married",2,false,-1,9773 +69,42,51,2,"married",0,false,-1,0 70,42,18,1,"child",0,true,-1,0 -71,43,52,1,"married",2,true,-1,8485 +71,43,52,1,"married",2,true,-1,7197 72,43,51,2,"married",0,false,-1,948 73,43,18,1,"child",0,false,-1,0 -74,44,52,1,"married",2,true,-1,2529 +74,44,52,1,"married",2,false,-1,1241 75,44,51,2,"married",0,false,-1,0 -76,44,18,1,"child",0,true,-1,472 -77,45,52,1,"married",2,false,-1,4863 +76,44,18,1,"child",0,false,-1,2852 +77,45,52,1,"married",2,false,-1,7439 78,45,51,2,"married",0,false,-1,0 79,45,18,1,"child",0,true,-1,0 -80,46,52,1,"married",2,false,-1,12068 -81,46,51,2,"married",0,false,-1,0 -82,46,18,1,"child",0,false,-1,712 -83,47,39,2,"married",1,true,1216798,23343 -84,47,39,1,"married",2,true,-1,9556 +80,46,52,1,"married",2,true,-1,12068 +81,46,51,2,"married",0,false,-1,2852 +82,46,18,1,"child",0,false,-1,236 +83,47,39,2,"single",1,true,1216798,21685 +84,105,39,1,"single",2,true,-1,9556 85,47,6,1,"child",0,false,-1,0 86,47,2,1,"child",0,false,-1,0 87,48,39,2,"married",2,true,-1,5195 -88,48,39,1,"married",2,false,-1,9230 +88,48,39,1,"married",2,false,-1,5846 89,48,6,1,"child",0,false,-1,0 -90,48,2,1,"child",0,false,-1,3804 -91,49,39,2,"married",1,true,232066,20839 -92,49,39,1,"married",2,false,-1,10098 -93,49,6,1,"child",0,false,-1,0 -94,49,2,1,"child",0,false,-1,3328 +90,48,2,1,"child",0,false,-1,3328 +91,49,39,2,"married",1,false,232066,19181 +92,49,39,1,"married",2,false,-1,11790 +93,49,6,1,"child",0,false,-1,236 +94,49,2,1,"child",0,false,-1,472 95,50,39,2,"married",1,true,1878693,21685 -96,50,39,1,"married",2,true,-1,770 -97,50,6,1,"child",0,false,-1,1188 +96,50,39,1,"married",2,true,-1,7538 +97,50,6,1,"child",0,false,-1,0 98,50,2,1,"child",0,false,-1,0 -99,51,39,2,"married",1,false,290900,20839 -100,51,39,1,"married",2,true,-1,13482 +99,51,39,2,"married",1,false,290900,19181 +100,51,39,1,"married",2,true,-1,15174 101,51,6,1,"child",0,false,-1,0 102,51,2,1,"child",0,false,-1,0 -103,52,39,2,"married",1,true,2177296,28317 -104,52,39,1,"married",2,true,-1,14024 +103,52,39,2,"married",1,false,2177296,25001 +104,52,39,1,"married",2,true,-1,15716 105,52,6,1,"child",0,false,-1,0 -106,52,2,1,"child",0,false,-1,3804 -107,53,39,2,"married",2,true,-1,7877 -108,53,39,1,"married",2,true,-1,8818 +106,52,2,1,"child",0,false,-1,0 +107,53,39,2,"married",2,true,-1,6536 +108,53,39,1,"married",2,true,-1,10510 109,53,6,1,"child",0,false,-1,0 110,53,2,1,"child",0,false,-1,0 -111,54,39,2,"married",2,true,-1,9175 -112,54,39,1,"married",2,true,-1,14024 +111,54,39,2,"married",2,false,-1,11857 +112,54,39,1,"married",2,true,-1,15716 113,54,6,1,"child",0,false,-1,0 -114,54,2,1,"child",0,false,-1,0 +114,54,2,1,"child",0,false,-1,3092 115,55,39,2,"married",2,true,-1,6536 -116,55,39,1,"married",2,true,-1,10922 -117,55,6,1,"child",0,false,-1,236 -118,55,2,1,"child",0,false,-1,948 -119,56,39,2,"married",2,false,-1,7877 -120,56,39,1,"married",2,false,-1,8406 +116,55,39,1,"married",2,false,-1,5846 +117,55,6,1,"child",0,false,-1,3092 +118,55,2,1,"child",0,false,-1,1900 +119,56,39,2,"married",2,true,-1,6536 +120,56,39,1,"married",2,true,-1,8406 121,56,6,1,"child",0,false,-1,0 122,56,2,1,"child",0,false,-1,0 -123,57,39,2,"married",2,true,-1,14539 -124,57,39,1,"married",2,false,-1,9230 -125,57,6,1,"child",0,false,-1,1424 -126,57,2,1,"child",0,false,-1,2376 -127,58,39,2,"married",2,true,-1,5195 -128,58,39,1,"married",2,true,-1,11790 -129,58,6,1,"child",0,false,-1,1424 -130,58,2,1,"child",0,false,-1,712 -131,59,39,2,"married",1,false,1821600,20839 -132,59,39,1,"married",2,true,-1,9230 -133,59,6,1,"child",0,false,-1,712 +123,57,39,2,"married",2,true,-1,7834 +124,57,39,1,"married",2,false,-1,5846 +125,57,6,1,"child",0,false,-1,0 +126,57,2,1,"child",0,false,-1,948 +127,58,39,2,"married",2,false,-1,9218 +128,58,39,1,"married",2,false,-1,13482 +129,58,6,1,"child",0,false,-1,2852 +130,58,2,1,"child",0,false,-1,2616 +131,59,39,2,"married",1,true,1821600,20839 +132,59,39,1,"married",2,true,-1,7538 +133,59,6,1,"child",0,false,-1,0 134,59,2,1,"child",0,false,-1,0 135,60,39,2,"married",2,true,-1,8992 -136,60,39,1,"married",2,true,-1,15716 +136,60,39,1,"married",2,false,-1,12332 137,60,6,1,"child",0,false,-1,0 -138,60,2,1,"child",0,false,-1,2616 -139,61,39,2,"married",1,true,379603,20027 +138,60,2,1,"child",0,false,-1,0 +139,61,39,2,"married",1,true,379603,23343 140,61,39,1,"married",2,true,-1,14024 141,61,6,1,"child",0,false,-1,0 142,61,2,1,"child",0,false,-1,2852 -143,62,39,2,"married",1,false,1649283,21685 +143,62,39,2,"married",1,true,1649283,23343 144,62,39,1,"married",2,true,-1,2874 -145,62,6,1,"child",0,false,-1,236 +145,62,6,1,"child",0,false,-1,0 146,62,2,1,"child",0,false,-1,0 -147,63,39,2,"married",2,true,-1,12179 -148,63,39,1,"married",2,false,-1,9230 +147,63,39,2,"married",2,false,-1,14861 +148,63,39,1,"married",2,false,-1,10922 149,63,6,1,"child",0,false,-1,0 -150,63,2,1,"child",0,false,-1,1188 -151,64,39,2,"married",2,true,-1,7877 -152,64,39,1,"married",2,true,-1,1182 +150,63,2,1,"child",0,false,-1,0 +151,64,39,2,"married",2,true,-1,5195 +152,64,39,1,"married",2,true,-1,6258 153,64,6,1,"child",0,false,-1,0 154,64,2,1,"child",0,false,-1,0 -155,65,39,2,"married",2,false,-1,2739 -156,65,39,1,"married",2,true,-1,10922 -157,65,6,1,"child",0,false,-1,1188 -158,65,2,1,"child",0,false,-1,1188 -159,66,39,2,"married",2,true,-1,10559 -160,66,39,1,"married",2,false,-1,11248 +155,65,39,2,"married",2,false,-1,57 +156,65,39,1,"married",2,true,-1,9230 +157,65,6,1,"child",0,false,-1,0 +158,65,2,1,"child",0,false,-1,0 +159,66,39,2,"married",2,true,-1,7877 +160,66,39,1,"married",2,true,-1,9556 161,66,6,1,"child",0,false,-1,0 -162,66,2,1,"child",0,false,-1,0 -163,67,39,2,"married",1,true,252790,28351 -164,67,39,1,"married",2,true,-1,11790 +162,66,2,1,"child",0,false,-1,236 +163,67,39,2,"married",1,false,252790,28351 +164,67,39,1,"married",2,true,-1,13482 165,67,6,1,"child",0,false,-1,948 166,67,2,1,"child",0,false,-1,0 -167,68,25,1,"single",2,true,-1,3431 -168,68,19,2,"child",2,false,-1,1981 -169,68,10,1,"child",0,false,-1,1900 -170,107,32,2,"single",2,true,-1,8635 -171,69,25,1,"married",2,true,-1,12017 -172,69,19,2,"child",1,true,2571751,5035 -173,69,10,1,"child",0,false,-1,236 -174,69,32,2,"married",2,true,-1,6055 -175,70,25,1,"married",2,true,-1,3073 -687,80,0,1,"child",0,false,0,0 +167,68,25,1,"married",2,true,-1,2492 +168,68,19,2,"child",2,true,-1,3251 +169,68,10,1,"child",0,false,-1,2376 +170,68,32,2,"married",2,true,-1,8635 +171,69,25,1,"married",2,true,-1,10139 +172,69,19,2,"child",1,true,2571751,4409 +173,69,10,1,"child",0,false,-1,0 +174,69,32,2,"married",2,true,-1,4765 +175,70,25,1,"married",2,true,-1,4012 176,70,19,2,"child",2,true,-1,1889 -177,70,10,1,"child",0,false,-1,0 -178,70,32,2,"married",2,true,-1,3568 -179,71,25,1,"married",1,true,2546087,8381 -180,71,19,2,"child",2,true,-1,3796 -181,71,10,1,"child",0,false,-1,2140 -182,71,32,2,"married",2,true,-1,3419 -183,72,25,1,"married",2,true,-1,0 -184,72,19,2,"child",2,true,-1,0 +177,70,10,1,"child",0,false,-1,712 +178,70,32,2,"married",2,true,-1,988 +690,67,0,1,"child",0,false,0,236 +179,71,25,1,"married",1,true,2546087,11609 +180,71,19,2,"child",2,true,-1,1764 +181,71,10,1,"child",0,false,-1,0 +182,71,32,2,"married",2,true,-1,2774 +183,72,25,1,"married",2,true,-1,6829 +184,72,19,2,"child",2,true,-1,2434 185,72,10,1,"child",0,false,-1,0 -186,72,32,2,"married",2,true,-1,6920 -187,73,25,1,"married",2,true,-1,4147 -188,73,19,2,"child",2,true,-1,0 -189,73,10,1,"child",0,false,-1,712 -190,73,32,2,"married",2,true,-1,8579 -191,105,25,1,"single",1,true,2567761,14857 -192,74,19,2,"child",2,true,-1,2706 +186,72,32,2,"married",2,true,-1,4985 +187,73,25,1,"single",2,true,-1,6025 +188,73,19,2,"child",2,true,-1,799 +189,73,10,1,"child",0,false,-1,2140 +190,106,32,2,"single",2,true,-1,4709 +191,74,25,1,"married",1,true,2567761,13781 +192,74,19,2,"child",2,false,-1,928 193,74,10,1,"child",0,false,-1,0 -194,74,32,2,"single",2,true,-1,0 -195,75,25,1,"married",2,true,-1,1195 -196,75,19,2,"child",2,true,-1,600 +194,74,32,2,"married",2,true,-1,5007 +195,75,25,1,"married",2,true,-1,0 +196,75,19,2,"child",2,true,-1,1616 197,75,10,1,"child",0,false,-1,0 -198,75,32,2,"married",2,true,-1,3482 -199,76,25,1,"married",1,true,5126369,5681 +198,75,32,2,"married",2,true,-1,2192 +199,76,25,1,"married",1,true,5126369,8909 200,76,19,2,"child",2,true,-1,3796 201,76,10,1,"child",0,false,-1,0 202,76,32,2,"married",1,true,2579434,6055 -203,77,25,1,"married",2,true,-1,228 -204,77,19,2,"child",2,true,-1,1510 -205,77,10,1,"child",0,false,-1,0 -206,77,32,2,"married",2,true,-1,2278 -207,78,25,1,"married",2,true,-1,4951 -208,106,19,2,"single",1,true,2544211,5489 -209,78,10,1,"child",0,false,-1,4280 -210,78,32,2,"married",2,true,-1,10563 -211,79,25,1,"married",2,true,-1,4370 -212,79,19,2,"child",1,true,2547600,1826 +203,77,25,1,"married",2,true,-1,8679 +204,77,19,2,"child",2,true,-1,1256 +205,77,10,1,"child",0,false,-1,3568 +206,77,32,2,"married",2,true,-1,3568 +207,78,25,1,"married",2,true,-1,6829 +208,78,19,2,"child",1,true,2544211,5802 +209,78,10,1,"child",0,false,-1,3804 +210,78,32,2,"married",2,true,-1,7338 +211,79,25,1,"married",2,true,-1,5309 +212,79,19,2,"child",1,true,2547600,0 213,79,10,1,"child",0,false,-1,0 -214,79,32,2,"married",2,true,-1,895 -215,80,25,1,"married",2,true,-1,3984 -216,80,19,2,"child",2,false,-1,2923 +214,79,32,2,"married",2,true,-1,4765 +215,80,25,1,"married",2,true,-1,7740 +216,80,19,2,"child",2,true,-1,2161 217,80,10,1,"child",0,false,-1,0 -218,80,32,2,"married",1,true,2575512,11186 +218,80,32,2,"married",1,true,2575512,10342 219,101,25,1,"single",2,true,-1,4012 -220,81,19,2,"child",2,true,-1,1889 +220,81,19,2,"child",2,true,-1,0 221,81,10,1,"child",0,false,-1,0 222,81,32,2,"single",2,true,-1,0 -223,82,25,1,"married",2,true,-1,11602 -224,82,19,2,"child",2,true,-1,4812 -225,82,10,1,"child",0,false,-1,4280 -226,82,32,2,"married",2,true,-1,5503 +223,82,25,1,"married",2,true,-1,5029 +224,82,19,2,"child",2,true,-1,1256 +225,82,10,1,"child",0,false,-1,1900 +226,82,32,2,"married",2,true,-1,2278 227,83,25,1,"married",2,true,-1,1776 -228,83,19,2,"child",2,true,-1,3796 +228,83,19,2,"child",2,true,-1,2526 229,83,10,1,"child",0,false,-1,0 230,83,32,2,"married",2,true,-1,6148 -231,84,83,2,"single",0,false,-1,3789 -233,86,83,2,"single",0,false,-1,6701 -234,87,83,2,"single",0,false,-1,5261 -235,88,83,2,"single",0,false,-1,1613 -236,89,83,2,"single",0,false,-1,1133 -237,90,83,2,"single",0,false,-1,3789 -238,91,83,2,"single",0,false,-1,4845 -239,92,83,2,"single",0,false,-1,6701 -240,93,83,2,"single",0,false,-1,2701 -241,94,83,2,"single",0,false,-1,6509 -242,95,83,2,"single",0,false,-1,8013 -244,97,83,2,"single",0,false,-1,3917 -245,98,83,2,"single",0,false,-1,4301 -246,99,83,2,"single",0,false,-1,5037 -359,76,1,1,"child",0,false,0,0 -436,71,1,1,"child",0,false,0,0 -500,102,24,1,"single",2,true,-1,589 -501,103,87,2,"single",0,false,-1,2698 -502,104,38,2,"married",1,true,1216798,17780 -503,104,38,1,"married",1,true,105186,24791 -504,104,5,1,"child",0,false,-1,0 -505,104,1,1,"child",0,false,-1,0 +231,84,83,2,"single",0,false,-1,4226 +232,85,83,2,"single",0,false,-1,5276 +233,86,83,2,"single",0,false,-1,6716 +234,87,83,2,"single",0,false,-1,5276 +235,88,83,2,"single",0,false,-1,801 +236,89,83,2,"single",0,false,-1,0 +237,90,83,2,"single",0,false,-1,2981 +238,91,83,2,"single",0,false,-1,5276 +239,92,83,2,"single",0,false,-1,4226 +240,93,83,2,"single",0,false,-1,3136 +241,94,83,2,"single",0,false,-1,2371 +242,95,83,2,"single",0,false,-1,7196 +244,97,83,2,"single",0,false,-1,5601 +245,98,83,2,"single",0,false,-1,996 +246,99,83,2,"single",0,false,-1,1736 +357,76,1,1,"child",0,false,0,0 +431,71,1,1,"child",0,false,0,0 +501,102,24,1,"single",2,true,-1,2645 +502,103,87,2,"single",0,false,-1,1615 +503,104,38,2,"married",1,true,1216798,17780 +504,104,38,1,"married",1,true,105186,26340 +505,104,5,1,"child",0,false,-1,0 +506,104,1,1,"child",0,false,-1,0 diff --git a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/dd_2001.csv b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/dd_2001.csv index 88e4c8b86..3805f66c4 100644 --- a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/dd_2001.csv +++ b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/dd_2001.csv @@ -1,106 +1,106 @@ id,zone,type,hhID,bedrooms,quality,monthlyCost,yearBuilt,coordX,coordY -1,864,"SFA",1,3,4,715,1990,NULL,NULL -2,933,"SFA",2,3,4,715,1990,NULL,NULL -3,870,"SFA",3,3,4,715,1994,NULL,NULL -4,862,"SFA",4,3,4,715,1992,NULL,NULL -5,870,"SFA",5,3,4,715,1993,NULL,NULL -6,858,"SFA",6,3,4,715,1994,NULL,NULL -7,872,"SFA",7,3,4,715,1990,NULL,NULL -8,911,"SFA",8,3,4,715,1990,NULL,NULL -9,864,"SFA",9,3,4,715,1992,NULL,NULL -10,870,"SFA",10,3,4,715,1994,NULL,NULL -11,927,"SFA",11,3,4,715,1991,NULL,NULL -12,862,"SFA",12,3,4,715,1994,NULL,NULL -13,870,"SFA",13,3,2,715,1991,NULL,NULL -14,873,"SFA",14,3,4,715,1990,NULL,NULL -15,873,"SFA",15,3,4,715,1991,NULL,NULL -16,916,"SFA",16,3,4,715,1992,NULL,NULL -17,910,"SFA",17,3,4,715,1994,NULL,NULL -18,915,"SFA",18,3,4,715,1991,NULL,NULL -19,864,"SFA",19,3,4,715,1993,NULL,NULL -20,863,"SFA",20,3,4,715,1992,NULL,NULL -21,864,"SFA",21,3,4,715,1994,NULL,NULL -22,873,"SFA",22,3,4,715,1990,NULL,NULL -23,921,"SFA",23,3,4,715,1992,NULL,NULL -24,861,"SFA",24,3,4,715,1990,NULL,NULL +1,864,"SFA",1,3,4,643,1990,NULL,NULL +2,933,"SFA",2,3,4,643,1990,NULL,NULL +3,870,"SFA",3,3,4,643,1994,NULL,NULL +4,862,"SFA",4,3,4,643,1992,NULL,NULL +5,870,"SFA",5,3,4,643,1993,NULL,NULL +6,858,"SFA",6,3,4,643,1994,NULL,NULL +7,872,"SFA",7,3,4,643,1990,NULL,NULL +8,911,"SFA",8,3,4,643,1990,NULL,NULL +9,864,"SFA",9,3,4,643,1992,NULL,NULL +10,870,"SFA",10,3,4,643,1994,NULL,NULL +11,927,"SFA",11,3,4,643,1991,NULL,NULL +12,862,"SFA",12,3,4,643,1994,NULL,NULL +13,870,"SFA",13,3,2,643,1991,NULL,NULL +14,873,"SFA",43,3,4,643,1990,NULL,NULL +15,873,"SFA",-1,3,4,643,1991,NULL,NULL +16,916,"SFA",16,3,4,643,1992,NULL,NULL +17,910,"SFA",17,3,4,643,1994,NULL,NULL +18,915,"SFA",18,3,4,643,1991,NULL,NULL +19,864,"SFA",19,3,4,643,1993,NULL,NULL +20,863,"SFA",20,3,4,643,1992,NULL,NULL +21,864,"SFA",21,3,4,643,1994,NULL,NULL +22,873,"SFA",22,3,4,643,1990,NULL,NULL +23,921,"SFA",23,3,4,643,1992,NULL,NULL +24,861,"SFA",24,3,4,643,1990,NULL,NULL 25,1072,"SFD",25,2,4,500,1936,NULL,NULL 26,1057,"SFD",26,2,4,500,1933,NULL,NULL -27,1069,"SFD",37,2,4,500,1931,NULL,NULL -28,1077,"SFD",-1,2,4,500,1933,NULL,NULL +27,1069,"SFD",-1,2,4,500,1931,NULL,NULL +28,1077,"SFD",28,2,4,500,1933,NULL,NULL 29,1059,"SFD",-1,2,4,500,1935,NULL,NULL 30,1068,"SFD",30,2,4,500,1932,NULL,NULL -31,1057,"SFD",-1,2,4,500,1930,NULL,NULL -32,1078,"SFD",32,2,4,500,1938,NULL,NULL +31,1057,"SFD",31,2,4,500,1930,NULL,NULL +32,1078,"SFD",-1,2,4,500,1938,NULL,NULL 33,1074,"SFD",33,2,3,500,1935,NULL,NULL -34,1061,"SFD",34,2,4,500,1936,NULL,NULL +34,1061,"SFD",-1,2,4,500,1936,NULL,NULL 35,1059,"SFD",35,2,4,500,1939,NULL,NULL -36,1057,"SFD",31,2,3,500,1938,NULL,NULL +36,1057,"SFD",-1,2,3,500,1938,NULL,NULL 37,1074,"SFD",-1,2,3,500,1937,NULL,NULL 38,1079,"SFD",38,2,4,500,1938,NULL,NULL -39,1055,"SFD",28,2,4,500,1934,NULL,NULL +39,1055,"SFD",-1,2,4,500,1934,NULL,NULL 40,1063,"SFD",40,2,4,500,1933,NULL,NULL -41,1095,"SFD",41,3,2,870,1965,NULL,NULL -42,1136,"SFD",42,3,2,870,1969,NULL,NULL -43,1135,"SFD",43,3,2,870,1965,NULL,NULL -44,1099,"SFD",44,3,2,870,1969,NULL,NULL -45,1117,"SFD",45,3,2,870,1968,NULL,NULL -46,1148,"SFD",46,3,2,870,1966,NULL,NULL -47,571,"SFD",47,4,4,1772,1997,NULL,NULL -48,585,"SFD",48,4,3,1772,1997,NULL,NULL -49,583,"SFD",49,4,3,1772,1995,NULL,NULL -50,593,"SFD",50,4,4,1772,1996,NULL,NULL -51,586,"SFD",51,4,4,1772,1995,NULL,NULL -52,589,"SFD",52,4,4,1772,1998,NULL,NULL -53,541,"SFD",53,4,4,1772,1996,NULL,NULL -54,575,"SFD",54,4,4,1772,1995,NULL,NULL -55,567,"SFD",55,4,4,1772,1998,NULL,NULL -56,541,"SFD",56,4,4,1772,1996,NULL,NULL -57,589,"SFD",57,4,4,1772,1995,NULL,NULL -58,599,"SFD",58,4,4,1772,1998,NULL,NULL -59,564,"SFD",59,4,4,1772,1997,NULL,NULL -60,565,"SFD",60,4,4,1772,1996,NULL,NULL -61,565,"SFD",61,4,4,1772,1997,NULL,NULL -62,582,"SFD",62,4,4,1772,1996,NULL,NULL -63,594,"SFD",63,4,4,1772,1996,NULL,NULL -64,571,"SFD",64,4,2,1772,1996,NULL,NULL -65,565,"SFD",65,4,4,1772,1997,NULL,NULL -66,582,"SFD",66,4,4,1772,1998,NULL,NULL -67,566,"SFD",67,4,4,1772,1996,NULL,NULL -68,1165,"SFD",68,3,4,657,1998,NULL,NULL -69,1178,"SFD",69,3,4,657,1997,NULL,NULL -70,1155,"SFD",70,3,4,657,1996,NULL,NULL -71,1163,"SFD",-1,3,4,657,1998,NULL,NULL -72,1163,"SFD",72,3,4,657,1997,NULL,NULL -73,1167,"SFD",73,3,4,657,1995,NULL,NULL -74,1178,"SFD",74,3,4,657,1996,NULL,NULL -75,1141,"SFD",75,3,4,657,1998,NULL,NULL -76,1155,"SFD",76,3,4,657,1995,NULL,NULL -77,1145,"SFD",77,3,3,657,1995,NULL,NULL -78,1156,"SFD",78,3,3,657,1998,NULL,NULL -79,1174,"SFD",71,3,4,748,1997,NULL,NULL -80,1173,"SFD",80,3,3,657,1998,NULL,NULL -81,1157,"SFD",81,3,4,657,1997,NULL,NULL -82,1155,"SFD",82,3,4,657,1998,NULL,NULL -83,1162,"SFD",83,3,4,657,1996,NULL,NULL -84,19,"MF5plus",84,1,4,160,1975,NULL,NULL -85,1,"MF5plus",85,1,3,160,1974,NULL,NULL -86,1,"MF5plus",86,1,4,160,1977,NULL,NULL -87,24,"MF5plus",87,1,4,160,1977,NULL,NULL -88,24,"MF5plus",88,1,4,160,1974,NULL,NULL -89,23,"MF5plus",89,1,4,160,1976,NULL,NULL -90,19,"MF5plus",90,1,4,160,1971,NULL,NULL -91,1,"MF5plus",91,1,4,160,1973,NULL,NULL -92,24,"MF5plus",92,1,4,160,1975,NULL,NULL -93,19,"MF5plus",93,1,4,160,1971,NULL,NULL -94,1,"MF5plus",94,1,4,160,1976,NULL,NULL -95,21,"MF5plus",95,1,4,160,1979,NULL,NULL -96,20,"MF5plus",-1,1,4,160,1972,NULL,NULL -97,20,"MF5plus",97,1,4,160,1973,NULL,NULL -98,24,"MF5plus",98,1,4,160,1975,NULL,NULL -99,19,"MF5plus",99,1,4,160,1972,NULL,NULL -100,1,"MF5plus",-1,1,4,160,1973,NULL,NULL -101,581,"SFD",-1,4,4,148,2000,349254.178869233,4342224.8451820025 +41,1095,"SFD",41,3,2,990,1965,NULL,NULL +42,1136,"SFD",42,3,2,990,1969,NULL,NULL +43,1135,"SFD",71,3,2,990,1965,NULL,NULL +44,1099,"SFD",44,3,2,990,1969,NULL,NULL +45,1117,"SFD",45,3,2,990,1968,NULL,NULL +46,1148,"SFD",46,3,2,990,1966,NULL,NULL +47,571,"SFD",47,4,4,1980,1997,NULL,NULL +48,585,"SFD",48,4,3,1980,1997,NULL,NULL +49,583,"SFD",49,4,3,1980,1995,NULL,NULL +50,593,"SFD",50,4,4,1980,1996,NULL,NULL +51,586,"SFD",51,4,4,1980,1995,NULL,NULL +52,589,"SFD",52,4,4,1980,1998,NULL,NULL +53,541,"SFD",53,4,4,1980,1996,NULL,NULL +54,575,"SFD",54,4,4,1980,1995,NULL,NULL +55,567,"SFD",55,4,4,1980,1998,NULL,NULL +56,541,"SFD",56,4,4,1980,1996,NULL,NULL +57,589,"SFD",57,4,4,1980,1995,NULL,NULL +58,599,"SFD",58,4,4,1980,1998,NULL,NULL +59,564,"SFD",59,4,4,1980,1997,NULL,NULL +60,565,"SFD",60,4,4,1980,1996,NULL,NULL +61,565,"SFD",61,4,4,1980,1997,NULL,NULL +62,582,"SFD",62,4,4,1980,1996,NULL,NULL +63,594,"SFD",63,4,4,1980,1996,NULL,NULL +64,571,"SFD",64,4,2,1980,1996,NULL,NULL +65,565,"SFD",65,4,4,1980,1997,NULL,NULL +66,582,"SFD",66,4,4,1980,1998,NULL,NULL +67,566,"SFD",67,4,4,1980,1996,NULL,NULL +68,1165,"SFD",68,3,4,748,1998,NULL,NULL +69,1178,"SFD",69,3,4,748,1997,NULL,NULL +70,1155,"SFD",70,3,4,748,1996,NULL,NULL +71,1163,"SFD",37,3,4,748,1998,NULL,NULL +72,1163,"SFD",72,3,4,748,1997,NULL,NULL +73,1167,"SFD",73,3,4,748,1995,NULL,NULL +74,1178,"SFD",74,3,4,748,1996,NULL,NULL +75,1141,"SFD",75,3,4,748,1998,NULL,NULL +76,1155,"SFD",76,3,4,748,1995,NULL,NULL +77,1145,"SFD",77,3,3,748,1995,NULL,NULL +78,1156,"SFD",78,3,3,748,1998,NULL,NULL +79,1174,"SFD",79,3,4,748,1997,NULL,NULL +80,1173,"SFD",80,3,3,748,1998,NULL,NULL +81,1157,"SFD",81,3,4,748,1997,NULL,NULL +82,1155,"SFD",82,3,4,748,1998,NULL,NULL +83,1162,"SFD",83,3,4,748,1996,NULL,NULL +84,19,"MF5plus",84,1,4,159,1975,NULL,NULL +85,1,"MF5plus",85,1,3,159,1974,NULL,NULL +86,1,"MF5plus",86,1,4,159,1977,NULL,NULL +87,24,"MF5plus",87,1,4,159,1977,NULL,NULL +88,24,"MF5plus",88,1,4,159,1974,NULL,NULL +89,23,"MF5plus",89,1,4,159,1976,NULL,NULL +90,19,"MF5plus",90,1,4,159,1971,NULL,NULL +91,1,"MF5plus",91,1,4,159,1973,NULL,NULL +92,24,"MF5plus",92,1,4,159,1975,NULL,NULL +93,19,"MF5plus",93,1,4,159,1971,NULL,NULL +94,1,"MF5plus",94,1,4,159,1976,NULL,NULL +95,21,"MF5plus",95,1,4,159,1979,NULL,NULL +96,20,"MF5plus",-1,1,4,159,1972,NULL,NULL +97,20,"MF5plus",97,1,4,159,1973,NULL,NULL +98,24,"MF5plus",98,1,4,159,1975,NULL,NULL +99,19,"MF5plus",99,1,4,159,1972,NULL,NULL +100,1,"MF5plus",14,1,4,159,1973,NULL,NULL +101,581,"SFD",34,4,4,165,2000,349254.178869233,4342224.8451820025 102,952,"SFD",36,2,4,42,2000,312823.33660929714,4379709.753289761 -103,1131,"SFD",-1,3,4,60,2000,430602.002077716,4333371.6379696755 -104,901,"SFA",101,3,4,165,2000,352211.27639046154,4310062.653957178 -105,22,"MF5plus",79,1,4,150,2000,354093.31970647647,4352459.27429112 +103,1131,"SFD",32,3,4,68,2000,430602.002077716,4333371.6379696755 +104,901,"SFA",101,3,4,148,2000,352211.27639046154,4310062.653957178 +105,22,"MF5plus",15,1,4,149,2000,354093.31970647647,4352459.27429112 diff --git a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/hh_2001.csv b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/hh_2001.csv index d80dd3072..fa8346e6a 100644 --- a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/hh_2001.csv +++ b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/hh_2001.csv @@ -12,8 +12,8 @@ id,dwelling,hhSize,autos 11,11,2,2 12,12,2,3 13,13,2,2 -14,14,2,1 -15,15,2,2 +14,100,2,1 +15,105,2,2 16,16,2,2 17,17,2,2 18,18,2,2 @@ -25,20 +25,20 @@ id,dwelling,hhSize,autos 24,24,2,3 25,25,1,1 26,26,1,0 -28,39,1,1 +28,28,1,1 30,30,1,1 -31,36,1,1 -32,32,1,2 +31,31,1,1 +32,103,1,2 33,33,1,1 -34,34,1,1 +34,101,1,1 35,35,1,1 36,102,1,1 -37,27,1,1 +37,71,1,1 38,38,1,0 40,40,1,1 41,41,3,2 42,42,3,3 -43,43,3,2 +43,14,3,2 44,44,3,2 45,45,3,3 46,46,3,2 @@ -66,7 +66,7 @@ id,dwelling,hhSize,autos 68,68,4,2 69,69,4,3 70,70,4,1 -71,79,5,2 +71,43,5,2 72,72,4,3 73,73,4,3 74,74,4,3 @@ -74,7 +74,7 @@ id,dwelling,hhSize,autos 76,76,5,2 77,77,4,2 78,78,4,2 -79,105,4,1 +79,79,4,1 80,80,4,2 81,81,3,2 82,82,4,3 diff --git a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/pp_2001.csv b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/pp_2001.csv index 5abbfed5e..609f8e6e6 100644 --- a/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/pp_2001.csv +++ b/useCases/maryland/test/input/de/tum/bgu/msm/transportModel/matsim/SiloMatsimTest/testMain/pp_2001.csv @@ -241,5 +241,5 @@ id,hhid,age,gender,relationShip,occupation,driversLicense,workplace,income 244,97,82,2,"single",0,false,-1,7988 245,98,82,2,"single",0,false,-1,4628 246,99,82,2,"single",0,false,-1,7028 -359,76,0,1,"child",0,false,0,0 -436,71,0,1,"child",0,false,0,0 +357,76,0,1,"child",0,false,0,0 +431,71,0,1,"child",0,false,0,0 diff --git a/useCases/munich/src/main/java/de/tum/bgu/msm/ModelBuilderMuc.java b/useCases/munich/src/main/java/de/tum/bgu/msm/ModelBuilderMuc.java index 8974ca80c..a59aefd65 100644 --- a/useCases/munich/src/main/java/de/tum/bgu/msm/ModelBuilderMuc.java +++ b/useCases/munich/src/main/java/de/tum/bgu/msm/ModelBuilderMuc.java @@ -60,7 +60,9 @@ import de.tum.bgu.msm.models.transportModel.TransportModel; import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class ModelBuilderMuc { @@ -123,17 +125,22 @@ public static ModelContainer getModelContainerForMuc(DataContainerWithSchools da TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + + + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterMuc()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: SimpleCommuteModeChoice commuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, commuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/av/ModelBuilderMucAv.java b/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/av/ModelBuilderMucAv.java index 9150ca3f9..972bb745c 100644 --- a/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/av/ModelBuilderMucAv.java +++ b/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/av/ModelBuilderMucAv.java @@ -62,7 +62,9 @@ import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.schools.DataContainerWithSchools; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class ModelBuilderMucAv { @@ -125,17 +127,20 @@ public static ModelContainer getModelContainerAvForMuc(DataContainerWithSchools TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterMuc()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: CommuteModeChoice commuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, commuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderMuc.java b/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderMuc.java index 0abc0304c..185b3d185 100644 --- a/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderMuc.java +++ b/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/longCommutePenalty/LongCommutePenaltyModelBuilderMuc.java @@ -61,7 +61,9 @@ import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.schools.DataContainerWithSchools; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class LongCommutePenaltyModelBuilderMuc { @@ -124,17 +126,20 @@ public static ModelContainer getModelContainerForMuc(DataContainerWithSchools da TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterMuc()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: CommuteModeChoice commuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, commuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderMuc.java b/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderMuc.java index bbc3bb497..4b6641057 100644 --- a/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderMuc.java +++ b/useCases/munich/src/main/java/de/tum/bgu/msm/scenarios/oneCarPolicy/OneCarPolicyModelBuilderMuc.java @@ -60,7 +60,9 @@ import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.schools.DataContainerWithSchools; import de.tum.bgu.msm.utils.SiloUtil; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; +import org.matsim.core.scenario.ScenarioUtils; public class OneCarPolicyModelBuilderMuc { @@ -123,17 +125,20 @@ public static ModelContainer getModelContainerForMuc(DataContainerWithSchools da TransportModel transportModel; MatsimScenarioAssembler scenarioAssembler; + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + } switch (properties.transportModel.transportModelIdentifier) { case MITO_MATSIM: scenarioAssembler = new MitoMatsimScenarioAssembler(dataContainer, properties, new MitoDataConverterMuc()); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case MATSIM: CommuteModeChoice commuteModeChoice = new SimpleCommuteModeChoice(dataContainer, properties, SiloUtil.provideNewRandom()); scenarioAssembler = new SimpleCommuteModeChoiceMatsimScenarioAssembler(dataContainer, properties, commuteModeChoice); - transportModel = new MatsimTransportModel(dataContainer, config, properties, null, - ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, scenarioAssembler); + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: diff --git a/useCases/perth/src/main/java/run/ModelBuilderPerth.java b/useCases/perth/src/main/java/run/ModelBuilderPerth.java index 827037345..908eed012 100644 --- a/useCases/perth/src/main/java/run/ModelBuilderPerth.java +++ b/useCases/perth/src/main/java/run/ModelBuilderPerth.java @@ -2,7 +2,8 @@ import de.tum.bgu.msm.container.DataContainer; import de.tum.bgu.msm.container.ModelContainer; -import de.tum.bgu.msm.data.accessibility.MatsimAccessibility; +import de.tum.bgu.msm.matsim.MatsimData; +import de.tum.bgu.msm.matsim.accessibility.MatsimAccessibility; import de.tum.bgu.msm.data.dwelling.DwellingFactory; import de.tum.bgu.msm.data.household.HouseholdFactory; import de.tum.bgu.msm.data.person.PersonFactory; @@ -49,9 +50,9 @@ import de.tum.bgu.msm.properties.Properties; import de.tum.bgu.msm.utils.SiloUtil; import org.apache.log4j.Logger; +import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; - -import java.util.Random; +import org.matsim.core.scenario.ScenarioUtils; public class ModelBuilderPerth { @@ -117,9 +118,12 @@ dataContainer, properties, new DefaultMovesStrategy(), new CarOnlyHousingStrateg logger.warn("Mito not implemented for perth. Defaulting to simple matsim transport model"); case MATSIM: final SimpleMatsimScenarioAssembler scenarioAssembler = new SimpleMatsimScenarioAssembler(dataContainer, properties); - transportModel = new MatsimTransportModel(dataContainer, config, properties, - (MatsimAccessibility) dataContainer.getAccessibility(), - ZoneConnectorManager.ZoneConnectorMethod.RANDOM, scenarioAssembler); + MatsimData matsimData = null; + if (config != null) { + final Scenario scenario = ScenarioUtils.loadScenario(config); + matsimData = new MatsimData(config, properties, ZoneConnectorManager.ZoneConnectorMethod.WEIGHTED_BY_POPULATION, dataContainer, scenario.getNetwork(), scenario.getTransitSchedule()); + }; + transportModel = new MatsimTransportModel(dataContainer, config, properties, scenarioAssembler, matsimData); break; case NONE: default: