edu.kit.ifv.mobitopp.simulation.modeChoice.ModeChoiceSimple Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mobitopp Show documentation
Show all versions of mobitopp Show documentation
mobiTopp (http://mobitopp.ifv.kit.edu/) is an agent-based travel demand model developed at the Institute for transport studies at the Karlsruhe Institute of Technology (http://www.ifv.kit.edu/english/index.php). Publications about mobiTopp can be found on the project site (http://mobitopp.ifv.kit.edu/28.php).
The newest version!
package edu.kit.ifv.mobitopp.simulation.modeChoice;
import java.util.Map;
import java.util.Set;
import edu.kit.ifv.mobitopp.data.Zone;
import edu.kit.ifv.mobitopp.simulation.ImpedanceIfc;
import edu.kit.ifv.mobitopp.simulation.Mode;
import edu.kit.ifv.mobitopp.simulation.Person;
import edu.kit.ifv.mobitopp.simulation.activityschedule.ActivityIfc;
import edu.kit.ifv.mobitopp.util.logit.DefaultLogitModel;
import edu.kit.ifv.mobitopp.util.logit.LogitModel;
public class ModeChoiceSimple
implements ModeChoiceModel
{
private final ModeChoiceSimpleUtilityFunction utilityFunction;
private final LogitModel logitModel = new DefaultLogitModel();
public ModeChoiceSimple(ImpedanceIfc impedance) {
this.utilityFunction = new ModeChoiceSimpleUtilityFunction(impedance);
}
public Mode selectMode(
Person person,
Zone source,
Zone destination,
ActivityIfc previousActivity,
ActivityIfc nextActivity,
Set choiceSet,
double randomNumber
) {
Map utilities = this.utilityFunction.calculateUtilities(
person, source, destination,
previousActivity, nextActivity
,choiceSet
);
return logitModel.select(utilities, choiceSet, randomNumber);
}
}