public FreespeedTravelTimeAndDisutility(PlanCalcScoreConfigGroup cnScoringGroup) {
   this(
       cnScoringGroup.getModes().get(TransportMode.car).getMarginalUtilityOfTraveling() / 3600.0,
       cnScoringGroup.getPerforming_utils_hr() / 3600.0,
       //				cnScoringGroup.getMarginalUtlOfDistanceCar());
       cnScoringGroup.getModes().get(TransportMode.car).getMonetaryDistanceRate()
           * cnScoringGroup.getMarginalUtilityOfMoney());
 }
Exemplo n.º 2
0
  @Override
  public TravelDisutility createTravelDisutility(
      TravelTime timeCalculator, PlanCalcScoreConfigGroup cnScoringGroup) {
    double marginalutilityOfMoney = cnScoringGroup.getMarginalUtilityOfMoney();
    final ResDisCalculator resdiscal =
        new ResDisCalculator(
            tdf.createTravelDisutility(timeCalculator, cnScoringGroup),
            ecl,
            marginalutilityOfMoney,
            this.emissionModule,
            this.emissionCostModule);

    return resdiscal;
  }
 public SocialCostTravelDisutility(
     TravelTime travelTime,
     SocialCostCalculatorV2 scc,
     PlanCalcScoreConfigGroup cnScoringGroup) {
   this.travelTime = travelTime;
   this.scc = scc;
   this.marginalCostOfTime =
       (-cnScoringGroup.getModes().get(TransportMode.car).getMarginalUtilityOfTraveling()
               / 3600.0)
           + (cnScoringGroup.getPerforming_utils_hr() / 3600.0);
   this.marginalCostOfDistance =
       -cnScoringGroup.getModes().get(TransportMode.car).getMonetaryDistanceRate()
           * cnScoringGroup.getMarginalUtilityOfMoney();
 }
  public IncomeTravelCostCalculator(
      final TravelTime timeCalculator,
      PlanCalcScoreConfigGroup charyparNagelScoring,
      PersonHouseholdMapping personHouseholdMapping) {
    this.timeCalculator = timeCalculator;
    this.personHouseholdMapping = personHouseholdMapping;

    /* Usually, utility from traveling should be negative (it's a disutility)
     * but the cost should be positive. Thus negate the utility.
     * Distance dependent routing is only impelemted for car since pt is only pseudo transit*/

    //		this.distanceCostFactor = - charyparNagelScoring.getMarginalUtlOfDistanceCar();
    this.distanceCostFactor =
        -charyparNagelScoring.getModes().get(TransportMode.car).getMonetaryDistanceRate()
            * charyparNagelScoring.getMarginalUtilityOfMoney();

    // also opportunity costs of time have to be considered at this point (second summand)!
    this.betaTravelTime =
        (-charyparNagelScoring.getModes().get(TransportMode.car).getMarginalUtilityOfTraveling()
                / 3600.0)
            + (charyparNagelScoring.getPerforming_utils_hr() / 3600.0);
  }
Exemplo n.º 5
0
  protected static void init() {
    if (initialized) return;

    utilParams.clear();
    marginalUtilityOfWaiting = configGroup.getMarginalUtlOfWaiting_utils_hr() / 3600.0;
    marginalUtilityOfLateArrival = configGroup.getLateArrival_utils_hr() / 3600.0;
    marginalUtilityOfEarlyDeparture = configGroup.getEarlyDeparture_utils_hr() / 3600.0;
    marginalUtilityOfTraveling =
        configGroup.getModes().get(TransportMode.car).getMarginalUtilityOfTraveling() / 3600.0;
    marginalUtilityOfTravelingPT =
        configGroup.getModes().get(TransportMode.pt).getMarginalUtilityOfTraveling() / 3600.0;
    marginalUtilityOfTravelingWalk =
        configGroup.getModes().get(TransportMode.walk).getMarginalUtilityOfTraveling() / 3600.0;
    marginalUtilityOfPerforming = configGroup.getPerforming_utils_hr() / 3600.0;

    //		marginalUtilityOfPtFare = marginalUtilityOfPtFare;

    //		marginalUtilityOfFuel = configGroup.getMarginalUtlOfDistanceCar();
    marginalUtilityOfFuel =
        configGroup.getModes().get(TransportMode.car).getMonetaryDistanceRate()
            * configGroup.getMarginalUtilityOfMoney();

    abortedPlanScore =
        Math.min(
                Math.min(marginalUtilityOfLateArrival, marginalUtilityOfEarlyDeparture),
                Math.min(marginalUtilityOfTraveling, marginalUtilityOfWaiting))
            * 3600.0
            * 24.0; // SCENARIO_DURATION
    // TODO 24 has to be replaced by a variable like scenario_dur (see also other places below)

    readUtilityValues(configGroup);
    scoreActs =
        ((marginalUtilityOfPerforming != 0)
            || (marginalUtilityOfWaiting != 0)
            || (marginalUtilityOfLateArrival != 0)
            || (marginalUtilityOfEarlyDeparture != 0));
    initialized = true;
  }
  public PersonalScoringParameters(final PlanCalcScoreConfigGroup config) {
    this.usingOldScoringBelowZeroUtilityDuration =
        config.isUsingOldScoringBelowZeroUtilityDuration();

    marginalUtilityOfWaiting_s = config.getMarginalUtlOfWaiting_utils_hr() / 3600.0;
    marginalUtilityOfLateArrival_s = config.getLateArrival_utils_hr() / 3600.0;
    marginalUtilityOfEarlyDeparture_s = config.getEarlyDeparture_utils_hr() / 3600.0;
    marginalUtilityOfWaitingPt_s = config.getMarginalUtlOfWaitingPt_utils_hr() / 3600.0;
    marginalUtilityOfPerforming_s = config.getPerforming_utils_hr() / 3600.0;
    utilityOfLineSwitch = config.getUtilityOfLineSwitch();
    marginalUtilityOfMoney = config.getMarginalUtilityOfMoney();
    scoreActs =
        marginalUtilityOfPerforming_s != 0
            || marginalUtilityOfWaiting_s != 0
            || marginalUtilityOfLateArrival_s != 0
            || marginalUtilityOfEarlyDeparture_s != 0;

    SortedMap<String, ActivityUtilityParameters> tmpUtlParams =
        new TreeMap<String, ActivityUtilityParameters>();
    for (ActivityParams params : config.getActivityParams()) {
      ActivityUtilityParameters.Builder factory = new ActivityUtilityParameters.Builder(params);
      // the following was introduced in nov'12.  Also see setupTransitSimulation in Controler.
      // kai, nov'12
      if (params.getActivityType().equals(PtConstants.TRANSIT_ACTIVITY_TYPE)) {
        factory.setScoreAtAll(false);
      }
      tmpUtlParams.put(params.getActivityType(), factory.create());
    }
    utilParams = Collections.unmodifiableMap(tmpUtlParams);

    SortedMap<String, Mode> tmpModeParams = new TreeMap<String, Mode>();
    Map<String, ModeParams> modes = config.getModes();
    double worstMarginalUtilityOfTraveling_s = 0.0;
    for (Entry<String, ModeParams> mode : modes.entrySet()) {
      String modeName = mode.getKey();
      ModeParams modeParams = mode.getValue();
      double marginalUtilityOfTraveling_s = modeParams.getMarginalUtilityOfTraveling() / 3600.0;
      worstMarginalUtilityOfTraveling_s =
          Math.min(worstMarginalUtilityOfTraveling_s, marginalUtilityOfTraveling_s);
      double marginalUtilityOfDistance_m = modeParams.getMarginalUtilityOfDistance();
      double monetaryDistanceCostRate = modeParams.getMonetaryDistanceCostRate();
      double constant = modeParams.getConstant();
      Mode newModeParams =
          new Mode(
              marginalUtilityOfTraveling_s,
              marginalUtilityOfDistance_m,
              monetaryDistanceCostRate,
              constant);
      tmpModeParams.put(modeName, newModeParams);
    }
    modeParams = Collections.unmodifiableMap(tmpModeParams);

    abortedPlanScore =
        Math.min(
                Math.min(marginalUtilityOfLateArrival_s, marginalUtilityOfEarlyDeparture_s),
                Math.min(
                    worstMarginalUtilityOfTraveling_s - marginalUtilityOfPerforming_s,
                    marginalUtilityOfWaiting_s - marginalUtilityOfPerforming_s))
            * 3600.0
            * 24.0; // SCENARIO_DURATION
    // TODO 24 has to be replaced by a variable like scenario_dur (see also other places below)
    // This rather complicated definition has to do with the fact that exp(some_large_number)
    // relatively quickly becomes Inf.
    // In consequence, the abortedPlanScore needs to be more strongly negative than anything else,
    // but not much more.
    // kai, feb'12
  }