1 package org.matsim.core.utils.timing;
14 import com.google.common.base.Preconditions;
32 return new TimeInterpretation(interpretation, tripDurationHandling, simulationStartTime);
46 boolean onlyAdvance =
false;
48 switch (tripDurationHandling) {
52 case shiftActivityEndTimes:
56 throw new IllegalStateException();
82 if (activityIndex == -1) {
83 throw new IllegalStateException(
84 "Activity " + activity +
" not found in plan of agent " + plan.
getPerson().getId());
97 Preconditions.checkArgument(Double.isFinite(startTime));
99 switch (activityDurationInterpretation) {
103 case tryEndTimeThenDuration:
112 case minOfDurationAndEndTime:
127 throw new IllegalArgumentException(
128 "Unsupported 'activityDurationInterpretation' enum type: " + activityDurationInterpretation);
168 double now = startTime;
OptionalTime getEndTime()
double orElse(double other)
OptionalTime getMaximumDuration()
OptionalTime decideOnActivityEndTime(Activity activity, double startTime)
final ActivityDurationInterpretation activityDurationInterpretation
static TimeInterpretation create(ActivityDurationInterpretation interpretation, TripDurationHandling tripDurationHandling, double simulationStartTime)
final boolean onlyAdvance
PlansConfigGroup.TripDurationHandling getTripDurationHandling()
OptionalTime getStartTime()
final double simulationStartTime
TimeInterpretation(ActivityDurationInterpretation activityDurationInterpretation, TripDurationHandling tripDurationHandling, double simulationStartTime)
OptionalTime decideOnLegTravelTime(Leg leg)
double getSimulationStartTime()
OptionalTime getTravelTime()
static TimeInterpretation create(Config config)
OptionalTime decideOnActivityEndTimeAlongPlan(Activity activity, Plan plan)
static TimeInterpretation create(ActivityDurationInterpretation interpretation, TripDurationHandling tripDurationHandling)
List< PlanElement > getPlanElements()
final PlansConfigGroup plans()
static OptionalTime defined(double seconds)
OptionalTime checkAdvance(OptionalTime time, double startTime)
OptionalTime getTravelTime()
OptionalTime decideOnElementsEndTime(List<? extends PlanElement > elements, final double startTime)
OptionalTime decideOnElementEndTime(PlanElement element, double startTime)
static OptionalTime undefined()
PlansConfigGroup.ActivityDurationInterpretation getActivityDurationInterpretation()
OptionalTime or(OptionalTime optionalTime)