edu.kit.ifv.mobitopp.simulation.activityschedule.randomizer.ActivityStartAndDurationRandomizer 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.activityschedule.randomizer;
import java.util.ArrayList;
import java.util.List;
import edu.kit.ifv.mobitopp.data.PatternActivity;
import edu.kit.ifv.mobitopp.data.PatternActivityWeek;
public interface ActivityStartAndDurationRandomizer {
PatternActivity randomizeStartAndDuration(PatternActivity activity);
default PatternActivityWeek randomizeStartAndDuration(PatternActivityWeek week) {
List randomized = new ArrayList();
List activities = week.getPatternActivities();
if (!activities.isEmpty()) {
randomized.add(activities.get(0));
}
for (int i=1; i= 2) {
randomized.add(activities.get(activities.size()-1));
}
return new PatternActivityWeek(randomized);
}
}