Commit 38ae6bc4 authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Change activity determination and add minimum interaction value

parent 338db17b
...@@ -30,7 +30,7 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator { ...@@ -30,7 +30,7 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
} }
private double interaction(double value, double reference, double lambda) { private double interaction(double value, double reference, double lambda) {
return Math.pow(value / reference, lambda); return Math.pow(Math.max(0.001, value) / reference, lambda);
} }
private double estimateSociodemographics(SwissUtilityParameters.SociodemographicsParameters socioParameters, private double estimateSociodemographics(SwissUtilityParameters.SociodemographicsParameters socioParameters,
...@@ -53,17 +53,24 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator { ...@@ -53,17 +53,24 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
DiscreteModeChoiceTrip trip) { DiscreteModeChoiceTrip trip) {
/* /*
* TODO: How is "purpose" defined in the choice model? What if the destination * TODO: How is "purpose" defined in the choice model? What if the destination
* purpose is "home"? For now, we use the destination purpose. * purpose is "home"? For now, we use the destination purpose if it is not home,
* otherwise origin purpose.
*/ */
switch (trip.getDestinationActivity().getType()) { String purpose = trip.getDestinationActivity().getType();
if (purpose.equals("home")) {
purpose = trip.getOriginActivity().getType();
}
switch (purpose) {
case "work": case "work":
return purposeParameters.betaWork; return purposeParameters.betaWork;
case "education": case "education":
return purposeParameters.betaEducation; return purposeParameters.betaEducation;
case "leisure": case "leisure":
return purposeParameters.betaLeisure; return purposeParameters.betaLeisure;
case "errand": case "service":
return purposeParameters.betaErrand; return purposeParameters.betaErrand;
case "shop": case "shop":
return purposeParameters.betaShop; return purposeParameters.betaShop;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment