Commit 8ef60292 authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Age variable must be divided by 10 for choice model

parent 78d266fc
......@@ -38,8 +38,8 @@ public class SwissUtilityEstimator extends BaseUtilityEstimator {
PersonVariables personVariables) {
double utility = 0.0;
utility += socioParameters.betaAge * personVariables.age;
utility += socioParameters.betaAgeSquared * Math.pow(personVariables.age, 2.0);
utility += socioParameters.betaAge * personVariables.age_10a;
utility += socioParameters.betaAgeSquared * Math.pow(personVariables.age_10a, 2.0);
utility += socioParameters.betaIncome * personVariables.income_1000CHF;
utility += socioParameters.betaIncomeSquared * Math.pow(personVariables.income_1000CHF, 2.0);
......
......@@ -44,7 +44,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
List<TripCandidate> previousTrips, List<? extends PlanElement> routedTrip) {
PersonVariables personVariables = new PersonVariables();
personVariables.age = (Integer) person.getAttributes().getAttribute("age");
personVariables.age_10a = 0.1 * (Double) person.getAttributes().getAttribute("age");
personVariables.income_1000CHF = (Double) person.getAttributes().getAttribute("householdIncome") * 1e-3;
personVariables.isMale = ((String) person.getAttributes().getAttribute("sex")).equals("m");
personVariables.carAlwaysAvailable = ((String) person.getAttributes().getAttribute("carAvail"))
......
package ch.ethz.matsim.projects.astra_2018_002.mode_choice.base;
public class PersonVariables {
public int age = 0;
public double age_10a = 0;
public double income_1000CHF = 0.0;
public boolean isMale = false;
public boolean carAlwaysAvailable = false;
......
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