diff --git a/src/main/java/de/tum/bgu/msm/data/MitoZone.java b/src/main/java/de/tum/bgu/msm/data/MitoZone.java index ca4c0a9d..4c49f9dd 100644 --- a/src/main/java/de/tum/bgu/msm/data/MitoZone.java +++ b/src/main/java/de/tum/bgu/msm/data/MitoZone.java @@ -25,7 +25,7 @@ public class MitoZone implements Id{ private AreaTypeForModeChoice areaTypeHBWModeChoice; private AreaTypeForModeChoice areaTypeNHBOmodeChoice; - private float distanceToNearestRailStop; + private float distanceToNearestTransitStop; public MitoZone(int id, float size, AreaType areaType) { this.zoneId = id; @@ -41,13 +41,13 @@ public MitoZone(int id, float size, AreaType areaType) { public void setAreaTypeNHBOModeChoice(AreaTypeForModeChoice areaTypeNHBOModeChoice){this.areaTypeNHBOmodeChoice = areaTypeNHBOModeChoice;} - public float getDistanceToNearestRailStop() {return distanceToNearestRailStop;} + public float getDistanceToNearestTransitStop() {return distanceToNearestTransitStop;} /** - * Sets distance to nearest rail stop - * @param distanceToNearestRailStop distance in km + * Sets distance to nearest transit stop + * @param distanceToNearestTransitStop distance in km */ - public void setDistanceToNearestRailStop(float distanceToNearestRailStop) {this.distanceToNearestRailStop = distanceToNearestRailStop;} + public void setDistanceToNearestTransitStop(float distanceToNearestTransitStop) {this.distanceToNearestTransitStop = distanceToNearestTransitStop;} @Override public int getId() { diff --git a/src/main/java/de/tum/bgu/msm/io/input/readers/ModeChoiceInputReader.java b/src/main/java/de/tum/bgu/msm/io/input/readers/ModeChoiceInputReader.java index 9896cbca..79fc8bd2 100644 --- a/src/main/java/de/tum/bgu/msm/io/input/readers/ModeChoiceInputReader.java +++ b/src/main/java/de/tum/bgu/msm/io/input/readers/ModeChoiceInputReader.java @@ -10,7 +10,7 @@ public class ModeChoiceInputReader extends CSVReader { - private int railDistIndex; + private int transitDistIndex; private int zoneIndex; private int areaTypeHBWIndex; private int areaTypeNHBOIndex; @@ -22,7 +22,7 @@ public ModeChoiceInputReader(DataSet dataSet) { @Override protected void processHeader(String[] header) { zoneIndex = MitoUtil.findPositionInArray("zoneID", header); - railDistIndex = MitoUtil.findPositionInArray("distToRailStop", header); + transitDistIndex = MitoUtil.findPositionInArray("distToTransit", header); areaTypeHBWIndex = MitoUtil.findPositionInArray("areaTypeHBW", header); areaTypeNHBOIndex = MitoUtil.findPositionInArray("areaTypeNHBO", header); } @@ -30,17 +30,17 @@ protected void processHeader(String[] header) { @Override protected void processRecord(String[] record) { int zoneID = Integer.parseInt(record[zoneIndex]); - float distToRailStop = Float.parseFloat(record[railDistIndex]); + float distToTransit = Float.parseFloat(record[transitDistIndex]); AreaTypeForModeChoice areaTypeHBW = AreaTypeForModeChoice.valueOf(Integer.parseInt(record[areaTypeHBWIndex])); AreaTypeForModeChoice areaTypeNHBO = AreaTypeForModeChoice.valueOf(Integer.parseInt(record[areaTypeNHBOIndex])); MitoZone zone = dataSet.getZones().get(zoneID); - zone.setDistanceToNearestRailStop(distToRailStop); + zone.setDistanceToNearestTransitStop(distToTransit); zone.setAreaTypeHBWModeChoice(areaTypeHBW); zone.setAreaTypeNHBOModeChoice(areaTypeNHBO); } @Override public void read() { - super.read(Resources.INSTANCE.getString(Properties.AREA_TYPES_AND_RAIL_DISTANCE),","); + super.read(Resources.INSTANCE.getString(Properties.AREA_TYPES_AND_TRANSIT_DISTANCE),","); } } diff --git a/src/main/java/de/tum/bgu/msm/resources/Properties.java b/src/main/java/de/tum/bgu/msm/resources/Properties.java index d2e9c67f..56318bef 100644 --- a/src/main/java/de/tum/bgu/msm/resources/Properties.java +++ b/src/main/java/de/tum/bgu/msm/resources/Properties.java @@ -31,7 +31,7 @@ public class Properties { public static final String TRAIN_TRAVEL_TIME_SKIM = "train.travelTime"; public static final String AUTO_TRAVEL_DISTANCE_SKIM = "auto.travelDistance"; public static final String NMT_TRAVEL_DISTANCE_SKIM = "nmt.travelDistance"; - public static final String AREA_TYPES_AND_RAIL_DISTANCE = "areaTypes.distToRailStop"; + public static final String AREA_TYPES_AND_TRANSIT_DISTANCE = "areaTypes.distToTransit"; public static final String AUTONOMOUS_VEHICLE_CHOICE = "include.AVchoice"; diff --git a/src/main/resources/de/tum/bgu/msm/modules/modeChoice/ModeChoice b/src/main/resources/de/tum/bgu/msm/modules/modeChoice/ModeChoice index fe076aaf..72676eec 100644 --- a/src/main/resources/de/tum/bgu/msm/modules/modeChoice/ModeChoice +++ b/src/main/resources/de/tum/bgu/msm/modules/modeChoice/ModeChoice @@ -32,7 +32,7 @@ maleHBW = [0.0, -0.16, 0.22, -0.28, -0.25, -0.18, 0.0]; driversLicenseHBW = [0.0, -1.03, -1.86, -2.25, -2.09, -2.14, -2.16]; hhSizeHBW = [0.0, 0.063, 0.25, 0.17, 0.18, 0.15, 0.0]; hhAutosHBW = [0.0, -0.16, -1.11, -1.27, -1.26, -1.29, -0.73]; -distToRailStopHBW = [0.0, 0.0, 0.0, -0.36, -0.39, -0.40, 0.0]; +distToTransitStopHBW = [0.0, 0.0, 0.0, -0.36, -0.39, -0.40, 0.0]; coreCityHBW = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; mediumSizedCityHBW = [0.0, 0.0, -0.29, -0.70, -0.75, -1.05, -0.59]; townOrRuralCommunityHBW = [0.0, 0.071, -0.39, -0.86, -0.88, -1.22, -0.89]; @@ -52,7 +52,7 @@ gender = person.getGender(); driversLicense = person.hasDriversLicense(); hhSize = hh.getHhSize(); hhAutos = hh.getAutos(); -distToRailStop = trip.getTripOrigin().getDistanceToNearestRailStop(); +distToTransitStop = trip.getTripOrigin().getDistanceToNearestTransitStop(); areaType = trip.getTripOrigin().getAreaTypeHBWModeChoice(); if(income/12 <= 1500){ @@ -77,49 +77,49 @@ gcTramMetro = timeTramMetro + (travelDistanceAuto*transitFareEurosPerKm)/VOT7000 utilityAutoD = interceptHBW[0] + ageHBW[0]*age + maleHBW[0]*(gender.name().equals("MALE")) + driversLicenseHBW[0]*driversLicense + hhSizeHBW[0]*hhSize + hhAutosHBW[0]*hhAutos + - distToRailStopHBW[0]*distToRailStop + coreCityHBW[0]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[0]*distToTransitStop + coreCityHBW[0]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[0]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[0]*(areaType.name().equals("HBW_townOrRural")) + generalizedCostHBW[0]*gcAutoD; utilityAutoP = interceptHBW[1] + ageHBW[1]*age + maleHBW[1]*(gender.name().equals("MALE")) + driversLicenseHBW[1]*driversLicense + hhSizeHBW[1]*hhSize + hhAutosHBW[1]*hhAutos + - distToRailStopHBW[1]*distToRailStop + coreCityHBW[1]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[1]*distToTransitStop + coreCityHBW[1]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[1]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[1]*(areaType.name().equals("HBW_townOrRural")) + generalizedCostHBW[1]*gcAutoP; utilityBicycle = interceptHBW[2] + ageHBW[2]*age + maleHBW[2]*(gender.name().equals("MALE")) + driversLicenseHBW[2]*driversLicense + hhSizeHBW[2]*hhSize + hhAutosHBW[2]*hhAutos + - distToRailStopHBW[2]*distToRailStop + coreCityHBW[2]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[2]*distToTransitStop + coreCityHBW[2]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[2]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[2]*(areaType.name().equals("HBW_townOrRural")) + tripLengthHBW[2]*travelDistanceNMT; utilityBus = interceptHBW[3] + ageHBW[3]*age + maleHBW[3]*(gender.name().equals("MALE")) + driversLicenseHBW[3]*driversLicense + hhSizeHBW[3]*hhSize + hhAutosHBW[3]*hhAutos + - distToRailStopHBW[3]*distToRailStop + coreCityHBW[3]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[3]*distToTransitStop + coreCityHBW[3]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[3]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[3]*(areaType.name().equals("HBW_townOrRural")) + generalizedCostHBW[3]*gcBus; utilityTrain = interceptHBW[4] + ageHBW[4]*age + maleHBW[4]*(gender.name().equals("MALE")) + driversLicenseHBW[4]*driversLicense + hhSizeHBW[4]*hhSize + hhAutosHBW[4]*hhAutos + - distToRailStopHBW[4]*distToRailStop + coreCityHBW[4]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[4]*distToTransitStop + coreCityHBW[4]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[4]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[4]*(areaType.name().equals("HBW_townOrRural")) + generalizedCostHBW[4]*gcTrain; utilityTramMetro = interceptHBW[5] + ageHBW[5]*age + maleHBW[5]*(gender.name().equals("MALE")) + driversLicenseHBW[5]*driversLicense + hhSizeHBW[5]*hhSize + hhAutosHBW[5]*hhAutos + - distToRailStopHBW[5]*distToRailStop + coreCityHBW[5]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[5]*distToTransitStop + coreCityHBW[5]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[5]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[5]*(areaType.name().equals("HBW_townOrRural")) + generalizedCostHBW[5]*gcTramMetro; utilityWalk = interceptHBW[6] + ageHBW[6]*age + maleHBW[6]*(gender.name().equals("MALE")) + driversLicenseHBW[6]*driversLicense + hhSizeHBW[6]*hhSize + hhAutosHBW[6]*hhAutos + - distToRailStopHBW[6]*distToRailStop + coreCityHBW[6]*(areaType.name().equals("HBW_coreCity")) + + distToTransitStopHBW[6]*distToTransitStop + coreCityHBW[6]*(areaType.name().equals("HBW_coreCity")) + mediumSizedCityHBW[6]*(areaType.name().equals("HBW_mediumSizedCity")) + townOrRuralCommunityHBW[6]*(areaType.name().equals("HBW_townOrRural")) + tripLengthHBW[6]*travelDistanceNMT; @@ -147,7 +147,7 @@ interceptHBE = [0.0, 1.25, 2.82, 2.15, 1.73, 1.97, 5.14]; maleHBE = [0.0, -0.17, 0.0, -0.14, -0.15, -0.15, 0.0]; driversLicenseHBE = [0.0, -1.26, -0.43, -1.23, -0.75, -0.77, -0.55]; hhAutosHBE = [0.0, -0.11, -0.56, -0.52, -0.56, -0.70, -0.68]; -distToRailStopHBE = [0.0, 0.0, 0.0, -0.28, -0.26, -0.46, 0.0]; +distToTransitStopHBE = [0.0, 0.0, 0.0, -0.28, -0.26, -0.46, 0.0]; generalizedCostHBE = [-0.0025, -0.0025, 0.0, -0.0025, -0.0025, -0.0025, 0.0]; tripLengthHBE = [0.0, 0.0, -0.42, 0.0, 0.0, 0.0, -1.71]; @@ -162,7 +162,7 @@ income = hh.getIncome(); gender = person.getGender(); driversLicense = person.hasDriversLicense(); hhAutos = hh.getAutos(); -distToRailStop = trip.getTripOrigin().getDistanceToNearestRailStop(); +distToTransitStop = trip.getTripOrigin().getDistanceToNearestTransitStop(); if(income/12 <= 1500){ gcAutoD = timeAutoD + (travelDistanceAuto*fuelCostEurosPerKm)/VOT1500_HBW_HBE_autoD @@ -185,25 +185,25 @@ gcTramMetro = timeTramMetro + (travelDistanceAuto*transitFareEurosPerKm)/VOT7000 } utilityAutoD = interceptHBE[0] + maleHBE[0]*(gender.name().equals("MALE")) + driversLicenseHBE[0]*driversLicense + - hhAutosHBE[0]*hhAutos + distToRailStopHBE[0]*distToRailStop + generalizedCostHBE[0]*gcAutoD; + hhAutosHBE[0]*hhAutos + distToTransitStopHBE[0]*distToTransitStop + generalizedCostHBE[0]*gcAutoD; utilityAutoP = interceptHBE[1] + maleHBE[1]*(gender.name().equals("MALE")) + driversLicenseHBE[1]*driversLicense + - hhAutosHBE[1]*hhAutos + distToRailStopHBE[1]*distToRailStop + generalizedCostHBE[1]*gcAutoP; + hhAutosHBE[1]*hhAutos + distToTransitStopHBE[1]*distToTransitStop + generalizedCostHBE[1]*gcAutoP; utilityBicycle = interceptHBE[2] + maleHBE[2]*(gender.name().equals("MALE")) + driversLicenseHBE[2]*driversLicense + - hhAutosHBE[2]*hhAutos + distToRailStopHBE[2]*distToRailStop + tripLengthHBE[2]*travelDistanceNMT; + hhAutosHBE[2]*hhAutos + distToTransitStopHBE[2]*distToTransitStop + tripLengthHBE[2]*travelDistanceNMT; utilityBus = interceptHBE[3] + maleHBE[3]*(gender.name().equals("MALE")) + driversLicenseHBE[3]*driversLicense + - hhAutosHBE[3]*hhAutos + distToRailStopHBE[3]*distToRailStop + generalizedCostHBE[3]*gcBus; + hhAutosHBE[3]*hhAutos + distToTransitStopHBE[3]*distToTransitStop + generalizedCostHBE[3]*gcBus; utilityTrain = interceptHBE[4] + maleHBE[4]*(gender.name().equals("MALE")) + driversLicenseHBE[4]*driversLicense + - hhAutosHBE[4]*hhAutos + distToRailStopHBE[4]*distToRailStop + generalizedCostHBE[4]*gcTrain; + hhAutosHBE[4]*hhAutos + distToTransitStopHBE[4]*distToTransitStop + generalizedCostHBE[4]*gcTrain; utilityTramMetro = interceptHBE[5] + maleHBE[5]*(gender.name().equals("MALE")) + driversLicenseHBE[5]*driversLicense + - hhAutosHBE[5]*hhAutos + distToRailStopHBE[5]*distToRailStop + generalizedCostHBE[5]*gcTramMetro; + hhAutosHBE[5]*hhAutos + distToTransitStopHBE[5]*distToTransitStop + generalizedCostHBE[5]*gcTramMetro; utilityWalk = interceptHBE[6] + maleHBE[6]*(gender.name().equals("MALE")) + driversLicenseHBE[6]*driversLicense + - hhAutosHBE[6]*hhAutos + distToRailStopHBE[6]*distToRailStop + tripLengthHBE[6]*travelDistanceNMT; + hhAutosHBE[6]*hhAutos + distToTransitStopHBE[6]*distToTransitStop + tripLengthHBE[6]*travelDistanceNMT; logsumAuto = Math.log(Math.exp(utilityAutoD/nestingCoefficient) + Math.exp(utilityAutoP/nestingCoefficient)); logsumTransit = Math.log(Math.exp(utilityBus/nestingCoefficient) + Math.exp(utilityTrain/nestingCoefficient) + Math.exp(utilityTramMetro/nestingCoefficient)); @@ -228,7 +228,7 @@ interceptHBS = [0.0, 1.27, 2.58, 1.80, 1.36, 1.76, 5.01]; maleHBS = [0.0, -0.47, -0.14, -0.62, -0.47, -0.53, -0.15]; driversLicenseHBS = [0.0, -1.43, -1.86, -2.43, -2.46, -2.39, -2.10]; hhAutosHBS = [0.0, -0.03, -0.81, -1.88, -1.73, -1.88, -0.86]; -distToRailStopHBS = [0.0, 0.0, 0.0, -0.87, -0.68, -1.02, 0.0]; +distToTransitStopHBS = [0.0, 0.0, 0.0, -0.87, -0.68, -1.02, 0.0]; hhChildrenHBS = [0.0, -0.051, 0.0, 0.0, 0.0, 0.0, -0.17]; generalizedCostHBS_Sq = [-0.0000068, -0.0000068, 0.0, -0.0000068, -0.0000068, -0.0000068, 0.0]; tripLengthHBS = [0.0, 0.0, -0.42, 0.0, 0.0, 0.0, -1.46]; @@ -247,7 +247,7 @@ income = hh.getIncome(); gender = person.getGender(); driversLicense = person.hasDriversLicense(); hhAutos = hh.getAutos(); -distToRailStop = trip.getTripOrigin().getDistanceToNearestRailStop(); +distToTransitStop = trip.getTripOrigin().getDistanceToNearestTransitStop(); if(income/12 <= 1500){ gcAutoD = timeAutoD + (travelDistanceAuto*fuelCostEurosPerKm)/VOT1500_other_autoD @@ -270,31 +270,31 @@ gcTramMetro = timeTramMetro + (travelDistanceAuto*transitFareEurosPerKm)/VOT7000 } utilityAutoD = interceptHBS[0] + maleHBS[0]*(gender.name().equals("MALE")) + driversLicenseHBS[0]*driversLicense + - hhAutosHBS[0]*hhAutos + distToRailStopHBS[0]*distToRailStop + hhChildrenHBS[0]*hhChildren + + hhAutosHBS[0]*hhAutos + distToTransitStopHBS[0]*distToTransitStop + hhChildrenHBS[0]*hhChildren + generalizedCostHBS_Sq[0]*Math.pow(gcAutoD,2); utilityAutoP = interceptHBS[1] + maleHBS[1]*(gender.name().equals("MALE")) + driversLicenseHBS[1]*driversLicense + - hhAutosHBS[1]*hhAutos + distToRailStopHBS[1]*distToRailStop + hhChildrenHBS[1]*hhChildren + + hhAutosHBS[1]*hhAutos + distToTransitStopHBS[1]*distToTransitStop + hhChildrenHBS[1]*hhChildren + generalizedCostHBS_Sq[1]*Math.pow(gcAutoP,2); utilityBicycle = interceptHBS[2] + maleHBS[2]*(gender.name().equals("MALE")) + driversLicenseHBS[2]*driversLicense + - hhAutosHBS[2]*hhAutos + distToRailStopHBS[2]*distToRailStop + hhChildrenHBS[2]*hhChildren + + hhAutosHBS[2]*hhAutos + distToTransitStopHBS[2]*distToTransitStop + hhChildrenHBS[2]*hhChildren + tripLengthHBS[2]*travelDistanceNMT; utilityBus = interceptHBS[3] + maleHBS[3]*(gender.name().equals("MALE")) + driversLicenseHBS[3]*driversLicense + - hhAutosHBS[3]*hhAutos + distToRailStopHBS[3]*distToRailStop + hhChildrenHBS[3]*hhChildren + + hhAutosHBS[3]*hhAutos + distToTransitStopHBS[3]*distToTransitStop + hhChildrenHBS[3]*hhChildren + generalizedCostHBS_Sq[3]*Math.pow(gcBus,2); utilityTrain = interceptHBS[4] + maleHBS[4]*(gender.name().equals("MALE")) + driversLicenseHBS[4]*driversLicense + - hhAutosHBS[4]*hhAutos + distToRailStopHBS[4]*distToRailStop + hhChildrenHBS[4]*hhChildren + + hhAutosHBS[4]*hhAutos + distToTransitStopHBS[4]*distToTransitStop + hhChildrenHBS[4]*hhChildren + generalizedCostHBS_Sq[4]*Math.pow(gcTrain,2); utilityTramMetro = interceptHBS[5] + maleHBS[5]*(gender.name().equals("MALE")) + driversLicenseHBS[5]*driversLicense + - hhAutosHBS[5]*hhAutos + distToRailStopHBS[5]*distToRailStop + hhChildrenHBS[5]*hhChildren + + hhAutosHBS[5]*hhAutos + distToTransitStopHBS[5]*distToTransitStop + hhChildrenHBS[5]*hhChildren + generalizedCostHBS_Sq[5]*Math.pow(gcTramMetro,2); utilityWalk = interceptHBS[6] + maleHBS[6]*(gender.name().equals("MALE")) + driversLicenseHBS[6]*driversLicense + - hhAutosHBS[6]*hhAutos + distToRailStopHBS[6]*distToRailStop + hhChildrenHBS[6]*hhChildren + + hhAutosHBS[6]*hhAutos + distToTransitStopHBS[6]*distToTransitStop + hhChildrenHBS[6]*hhChildren + tripLengthHBS[6]*travelDistanceNMT; logsumAuto = Math.log(Math.exp(utilityAutoD/nestingCoefficient) + Math.exp(utilityAutoP/nestingCoefficient)); @@ -321,7 +321,7 @@ maleHBO = [0.0, -0.27, 0.17, -0.13, 0.0, -0.063, -0.13]; driversLicenseHBO = [0.0, -1.34, -1.51, -1.91, -1.66, -1.74, -1.30]; hhAutosHBO = [0.0, -0.029, -0.57, -1.54, -1.56, -1.72, -0.30]; hhSizeHBO = [0.0, 0.0, 0.0, -0.11, -0.11, -0.15, -0.19]; -distToRailStopHBO = [0.0, 0.0, 0.0, -0.61, -0.57, -0.58, -0.065]; +distToTransitStopHBO = [0.0, 0.0, 0.0, -0.61, -0.57, -0.58, -0.065]; generalizedCostHBO = [-0.0012, -0.0012, 0.0, -0.0012, -0.0012, -0.0012, 0.0]; tripLengthHBO = [0.0, 0.0, -0.15, 0.0, 0.0, 0.0, -0.68]; @@ -337,7 +337,7 @@ gender = person.getGender(); driversLicense = person.hasDriversLicense(); hhAutos = hh.getAutos(); hhSize = hh.getHhSize(); -distToRailStop = trip.getTripOrigin().getDistanceToNearestRailStop(); +distToTransitStop = trip.getTripOrigin().getDistanceToNearestTransitStop(); if(income/12 <= 1500){ gcAutoD = timeAutoD + (travelDistanceAuto*fuelCostEurosPerKm)/VOT1500_other_autoD @@ -360,31 +360,31 @@ gcTramMetro = timeTramMetro + (travelDistanceAuto*transitFareEurosPerKm)/VOT7000 } utilityAutoD = interceptHBO[0] + maleHBO[0]*(gender.name().equals("MALE")) + driversLicenseHBO[0]*driversLicense + - hhAutosHBO[0]*hhAutos + hhSizeHBO[0]*hhSize + distToRailStopHBO[0]*distToRailStop + + hhAutosHBO[0]*hhAutos + hhSizeHBO[0]*hhSize + distToTransitStopHBO[0]*distToTransitStop + generalizedCostHBO[0]*gcAutoD; utilityAutoP = interceptHBO[1] + maleHBO[1]*(gender.name().equals("MALE")) + driversLicenseHBO[1]*driversLicense + - hhAutosHBO[1]*hhAutos + hhSizeHBO[1]*hhSize + distToRailStopHBO[1]*distToRailStop + + hhAutosHBO[1]*hhAutos + hhSizeHBO[1]*hhSize + distToTransitStopHBO[1]*distToTransitStop + generalizedCostHBO[1]*gcAutoP; utilityBicycle = interceptHBO[2] + maleHBO[2]*(gender.name().equals("MALE")) + driversLicenseHBO[2]*driversLicense + - hhAutosHBO[2]*hhAutos + hhSizeHBO[2]*hhSize + distToRailStopHBO[2]*distToRailStop + + hhAutosHBO[2]*hhAutos + hhSizeHBO[2]*hhSize + distToTransitStopHBO[2]*distToTransitStop + tripLengthHBO[2]*travelDistanceNMT; utilityBus = interceptHBO[3] + maleHBO[3]*(gender.name().equals("MALE")) + driversLicenseHBO[3]*driversLicense + - hhAutosHBO[3]*hhAutos + hhSizeHBO[3]*hhSize + distToRailStopHBO[3]*distToRailStop + + hhAutosHBO[3]*hhAutos + hhSizeHBO[3]*hhSize + distToTransitStopHBO[3]*distToTransitStop + generalizedCostHBO[3]*gcBus; utilityTrain = interceptHBO[4] + maleHBO[4]*(gender.name().equals("MALE")) + driversLicenseHBO[4]*driversLicense + - hhAutosHBO[4]*hhAutos + hhSizeHBO[4]*hhSize + distToRailStopHBO[4]*distToRailStop + + hhAutosHBO[4]*hhAutos + hhSizeHBO[4]*hhSize + distToTransitStopHBO[4]*distToTransitStop + generalizedCostHBO[4]*gcTrain; utilityTramMetro = interceptHBO[5] + maleHBO[5]*(gender.name().equals("MALE")) + driversLicenseHBO[5]*driversLicense + - hhAutosHBO[5]*hhAutos + hhSizeHBO[5]*hhSize + distToRailStopHBO[5]*distToRailStop + + hhAutosHBO[5]*hhAutos + hhSizeHBO[5]*hhSize + distToTransitStopHBO[5]*distToTransitStop + generalizedCostHBO[5]*gcTramMetro; utilityWalk = interceptHBO[6] + maleHBO[6]*(gender.name().equals("MALE")) + driversLicenseHBO[6]*driversLicense + - hhAutosHBO[6]*hhAutos + hhSizeHBO[6]*hhSize + distToRailStopHBO[6]*distToRailStop + + hhAutosHBO[6]*hhAutos + hhSizeHBO[6]*hhSize + distToTransitStopHBO[6]*distToTransitStop + tripLengthHBO[6]*travelDistanceNMT; logsumAuto = Math.log(Math.exp(utilityAutoD/nestingCoefficient) + Math.exp(utilityAutoP/nestingCoefficient)); @@ -410,7 +410,7 @@ interceptNHBW = [0.0, 0.68, 2.02, 0.65, 1.21, 1.0, 4.74]; ageNHBW = [0.0, -0.0045, 0.0, 0.0, -0.0059, 0.0, -0.011]; driversLicenseNHBW = [0.0, -0.94, -1.56, -1.61, -1.67, -1.37, -1.43]; hhAutosNHBW = [0.0, -0.11, -1.12, -1.23, -1.44, -1.52, -0.47]; -distToRailStopNHBW = [0.0, 0.0, 0.0, -0.24, 0.0, -0.16, -0.37]; +distToTransitStopNHBW = [0.0, 0.0, 0.0, -0.24, 0.0, -0.16, -0.37]; generalizedCostNHBW = [-0.0034, -0.0034, 0.0, -0.0034, -0.0034, -0.0034, 0.0]; tripLengthNHBW = [0.0, 0.0, -0.28, 0.0, 0.0, 0.0, -1.54]; @@ -425,7 +425,7 @@ income = hh.getIncome(); age = person.getAge(); driversLicense = person.hasDriversLicense(); hhAutos = hh.getAutos(); -distToRailStop = trip.getTripOrigin().getDistanceToNearestRailStop(); +distToTransitStop = trip.getTripOrigin().getDistanceToNearestTransitStop(); if(income/12 <= 1500){ gcAutoD = timeAutoD + (travelDistanceAuto*fuelCostEurosPerKm)/VOT1500_other_autoD @@ -448,25 +448,25 @@ gcTramMetro = timeTramMetro + (travelDistanceAuto*transitFareEurosPerKm)/VOT7000 } utilityAutoD = interceptNHBW[0] + ageNHBW[0]*age + driversLicenseNHBW[0]*driversLicense + - hhAutosNHBW[0]*hhAutos + distToRailStopNHBW[0]*distToRailStop + generalizedCostNHBW[0]*gcAutoD; + hhAutosNHBW[0]*hhAutos + distToTransitStopNHBW[0]*distToTransitStop + generalizedCostNHBW[0]*gcAutoD; utilityAutoP = interceptNHBW[1] + ageNHBW[1]*age + driversLicenseNHBW[1]*driversLicense + - hhAutosNHBW[1]*hhAutos + distToRailStopNHBW[1]*distToRailStop + generalizedCostNHBW[1]*gcAutoP; + hhAutosNHBW[1]*hhAutos + distToTransitStopNHBW[1]*distToTransitStop + generalizedCostNHBW[1]*gcAutoP; utilityBicycle = interceptNHBW[2] + ageNHBW[2]*age + driversLicenseNHBW[2]*driversLicense + - hhAutosNHBW[2]*hhAutos + distToRailStopNHBW[2]*distToRailStop + tripLengthNHBW[2]*travelDistanceNMT; + hhAutosNHBW[2]*hhAutos + distToTransitStopNHBW[2]*distToTransitStop + tripLengthNHBW[2]*travelDistanceNMT; utilityBus = interceptNHBW[3] + ageNHBW[3]*age + driversLicenseNHBW[3]*driversLicense + - hhAutosNHBW[3]*hhAutos + distToRailStopNHBW[3]*distToRailStop + generalizedCostNHBW[3]*gcBus; + hhAutosNHBW[3]*hhAutos + distToTransitStopNHBW[3]*distToTransitStop + generalizedCostNHBW[3]*gcBus; utilityTrain = interceptNHBW[4] + ageNHBW[4]*age + driversLicenseNHBW[4]*driversLicense + - hhAutosNHBW[4]*hhAutos + distToRailStopNHBW[4]*distToRailStop + generalizedCostNHBW[4]*gcTrain; + hhAutosNHBW[4]*hhAutos + distToTransitStopNHBW[4]*distToTransitStop + generalizedCostNHBW[4]*gcTrain; utilityTramMetro = interceptNHBW[5] + ageNHBW[5]*age + driversLicenseNHBW[5]*driversLicense + - hhAutosNHBW[5]*hhAutos + distToRailStopNHBW[5]*distToRailStop + generalizedCostNHBW[5]*gcTramMetro; + hhAutosNHBW[5]*hhAutos + distToTransitStopNHBW[5]*distToTransitStop + generalizedCostNHBW[5]*gcTramMetro; utilityWalk = interceptNHBW[6] + ageNHBW[6]*age + driversLicenseNHBW[6]*driversLicense + - hhAutosNHBW[6]*hhAutos + distToRailStopNHBW[6]*distToRailStop + tripLengthNHBW[6]*travelDistanceNMT; + hhAutosNHBW[6]*hhAutos + distToTransitStopNHBW[6]*distToTransitStop + tripLengthNHBW[6]*travelDistanceNMT; logsumAuto = Math.log(Math.exp(utilityAutoD/nestingCoefficient) + Math.exp(utilityAutoP/nestingCoefficient)); logsumTransit = Math.log(Math.exp(utilityBus/nestingCoefficient) + Math.exp(utilityTrain/nestingCoefficient) + Math.exp(utilityTramMetro/nestingCoefficient)); @@ -490,7 +490,7 @@ interceptNHBO = [0.0, 1.23, 1.08, 0.56, 0.41, 0.59, 2.89]; maleNHBO = [0.0, -0.24, 0.0, -0.20, -0.23, -0.18, -0.073]; driversLicenseNHBO = [0.0, -1.40, -1.49, -2.02, -1.74, -1.77, -1.44]; hhAutosNHBO = [0.0, -0.029, -0.73, -0.80, -0.85, -0.86, -0.40]; -distToRailStopNHBO = [0.0, 0.0, 0.0, -0.40, -0.44, -0.48, 0.0]; +distToTransitStopNHBO = [0.0, 0.0, 0.0, -0.40, -0.44, -0.48, 0.0]; agglomerationUrbanNHBO = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; ruralNHBO = [0.0, 0.0, 0.0, -0.70, -0.91, -1.12, 0.0]; generalizedCostNHBO_Sq = [-0.000017, -0.000017, 0.0, -0.000017, -0.000017, -0.000017, 0.0]; @@ -507,7 +507,7 @@ income = hh.getIncome(); gender = person.getGender(); driversLicense = person.hasDriversLicense(); hhAutos = hh.getAutos(); -distToRailStop = trip.getTripOrigin().getDistanceToNearestRailStop(); +distToTransitStop = trip.getTripOrigin().getDistanceToNearestTransitStop(); areaType = trip.getTripOrigin().getAreaTypeNHBOModeChoice(); if(income/12 <= 1500){ @@ -531,37 +531,37 @@ gcTramMetro = timeTramMetro + (travelDistanceAuto*transitFareEurosPerKm)/VOT7000 } utilityAutoD = interceptNHBO[0] + maleNHBO[0]*(gender.name().equals("MALE")) + driversLicenseNHBO[0]*driversLicense + - hhAutosNHBO[0]*hhAutos + distToRailStopNHBO[0]*distToRailStop + + hhAutosNHBO[0]*hhAutos + distToTransitStopNHBO[0]*distToTransitStop + agglomerationUrbanNHBO[0]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[0]*(areaType.name().equals("NHBO_rural")) + generalizedCostNHBO_Sq[0]*Math.pow(gcAutoD,2); utilityAutoP = interceptNHBO[1] + maleNHBO[1]*(gender.name().equals("MALE")) + driversLicenseNHBO[1]*driversLicense + - hhAutosNHBO[1]*hhAutos + distToRailStopNHBO[1]*distToRailStop + + hhAutosNHBO[1]*hhAutos + distToTransitStopNHBO[1]*distToTransitStop + agglomerationUrbanNHBO[1]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[1]*(areaType.name().equals("NHBO_rural")) + generalizedCostNHBO_Sq[1]*Math.pow(gcAutoP,2); utilityBicycle = interceptNHBO[2] + maleNHBO[2]*(gender.name().equals("MALE")) + driversLicenseNHBO[2]*driversLicense + - hhAutosNHBO[2]*hhAutos + distToRailStopNHBO[2]*distToRailStop + + hhAutosNHBO[2]*hhAutos + distToTransitStopNHBO[2]*distToTransitStop + agglomerationUrbanNHBO[2]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[2]*(areaType.name().equals("NHBO_rural")) + tripLengthNHBO[2]*travelDistanceNMT; utilityBus = interceptNHBO[3] + maleNHBO[3]*(gender.name().equals("MALE")) + driversLicenseNHBO[3]*driversLicense + - hhAutosNHBO[3]*hhAutos + distToRailStopNHBO[3]*distToRailStop + + hhAutosNHBO[3]*hhAutos + distToTransitStopNHBO[3]*distToTransitStop + agglomerationUrbanNHBO[3]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[3]*(areaType.name().equals("NHBO_rural")) + generalizedCostNHBO_Sq[3]*Math.pow(gcBus,2); utilityTrain = interceptNHBO[4] + maleNHBO[4]*(gender.name().equals("MALE")) + driversLicenseNHBO[4]*driversLicense + - hhAutosNHBO[4]*hhAutos + distToRailStopNHBO[4]*distToRailStop + + hhAutosNHBO[4]*hhAutos + distToTransitStopNHBO[4]*distToTransitStop + agglomerationUrbanNHBO[4]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[4]*(areaType.name().equals("NHBO_rural")) + generalizedCostNHBO_Sq[4]*Math.pow(gcTrain,2); utilityTramMetro = interceptNHBO[5] + maleNHBO[5]*(gender.name().equals("MALE")) + driversLicenseNHBO[5]*driversLicense + - hhAutosNHBO[5]*hhAutos + distToRailStopNHBO[5]*distToRailStop + + hhAutosNHBO[5]*hhAutos + distToTransitStopNHBO[5]*distToTransitStop + agglomerationUrbanNHBO[5]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[5]*(areaType.name().equals("NHBO_rural")) + generalizedCostNHBO_Sq[5]*Math.pow(gcTramMetro,2); utilityWalk = interceptNHBO[6] + maleNHBO[6]*(gender.name().equals("MALE")) + driversLicenseNHBO[6]*driversLicense + - hhAutosNHBO[6]*hhAutos + distToRailStopNHBO[6]*distToRailStop + + hhAutosNHBO[6]*hhAutos + distToTransitStopNHBO[6]*distToTransitStop + agglomerationUrbanNHBO[6]*(areaType.name().equals("NHBO_agglomeration")+areaType.name().equals("NHBO_urban")) + ruralNHBO[6]*(areaType.name().equals("NHBO_rural")) + tripLengthNHBO[6]*travelDistanceNMT; diff --git a/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceCalculatorTest.java b/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceCalculatorTest.java index f59c867e..cc8c90eb 100644 --- a/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceCalculatorTest.java +++ b/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceCalculatorTest.java @@ -16,21 +16,21 @@ public class ModeChoiceCalculatorTest { private ModeChoiceJSCalculator calculator; - private final double[] reference = new double[]{0.35258741,0.21025060,0.07781168,0.01532404,0.00755559,0.01247863,0.00364841,0.35258208,0.01560092}; + private final double[] reference = new double[]{0.585260323,0.273709615,0.08747526,0.023052124,0.009195227,0.017205939,0.00410151}; @Before public void setup() { Resources.initializeResources("./testInput/test.properties", Implementation.MUNICH); - Reader reader = new InputStreamReader(this.getClass().getResourceAsStream("ModeChoiceAV")); + Reader reader = new InputStreamReader(this.getClass().getResourceAsStream("ModeChoice")); calculator = new ModeChoiceJSCalculator(reader); } @Test public void test() { MitoZone origin = new MitoZone(1, 100, null); - origin.setDistanceToNearestRailStop(0.5f); + origin.setDistanceToNearestTransitStop(0.5f); //origin.setAreaTypeHBWModeChoice(AreaTypeForModeChoice.HBW_mediumSizedCity); MitoHousehold hh = new MitoHousehold(1, 20000, 1, null); MitoPerson pp = new MitoPerson(1, Occupation.STUDENT, 1, 20, Gender.FEMALE, true); diff --git a/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceTest.java b/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceTest.java index 6b76b95d..6c3bd985 100644 --- a/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceTest.java +++ b/src/test/java/de/tum/bgu/msm/modules/modeChoice/ModeChoiceTest.java @@ -1,10 +1,7 @@ package de.tum.bgu.msm.modules.modeChoice; -import cern.colt.matrix.tdouble.DoubleMatrix2D; import de.tum.bgu.msm.data.*; -import de.tum.bgu.msm.data.travelTimes.TravelTimes; import de.tum.bgu.msm.util.MitoUtil; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -47,7 +44,7 @@ private void fillDataSet() { MitoPerson person1 = new MitoPerson(1, Occupation.WORKER, -1, 30, Gender.MALE, true); trip1.setPerson(person1); MitoZone zone1 = new MitoZone(1, 100, AreaType.URBAN); - zone1.setDistanceToNearestRailStop(0.5f); + zone1.setDistanceToNearestTransitStop(0.5f); zone1.setAreaTypeHBWModeChoice(AreaTypeForModeChoice.HBW_coreCity); trip1.setTripOrigin(zone1); MitoZone zone2 = new MitoZone(2, 100, AreaType.URBAN); @@ -67,7 +64,7 @@ private void fillDataSet() { MitoPerson person2 = new MitoPerson(2, Occupation.WORKER, -1, 30, Gender.MALE, true); trip2.setPerson(person2); MitoZone zone3 = new MitoZone(3, 100, AreaType.URBAN); - zone3.setDistanceToNearestRailStop(0.5f); + zone3.setDistanceToNearestTransitStop(0.5f); zone3.setAreaTypeHBWModeChoice(AreaTypeForModeChoice.HBW_coreCity); trip2.setTripOrigin(zone3); MitoZone zone4 = new MitoZone(4, 100, AreaType.URBAN); diff --git a/testInput/test.properties b/testInput/test.properties index 5e0129aa..b1cc5624 100644 --- a/testInput/test.properties +++ b/testInput/test.properties @@ -37,7 +37,7 @@ bus.travelTime = ./testInput/CheapJrnyTime.omx tramMetro.travelTime = ./testInput/CheapJrnyTime.omx train.travelTime = ./testInput/CheapJrnyTime.omx auto.travelDistance = ./testInput/CheapJrnyTime.omx -areaTypes.distToRailStop = ./testInput/zones_areaType_distToRailStop.csv +areaTypes.distToTransit = ./testInput/zones_areaType_distToTransit.csv # Output files non.motorized.trips = output/nonMotorizedTrips.csv diff --git a/testInput/zones_areaType_distToRailStop.csv b/testInput/zones_areaType_distToRailStop.csv deleted file mode 100644 index 087ffc03..00000000 --- a/testInput/zones_areaType_distToRailStop.csv +++ /dev/null @@ -1,2 +0,0 @@ -zoneID,distToRailStop,areaTypeHBW,areaTypeNHBO -1,5.561101203,40,2