1 package org.opentrafficsim.road.gtu.lane.tactical.lmrs;
2
3 import org.opentrafficsim.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
4 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException;
5 import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
6 import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
7 import org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel;
8 import org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.Desire;
9 import org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.LmrsUtil;
10 import org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.VoluntaryIncentive;
11
12
13
14
15
16
17
18
19
20
21
22
23 public class IncentiveKeep implements VoluntaryIncentive
24 {
25
26
27 @Override
28 public final Desire determineDesire(final BehavioralCharacteristics behavioralCharacteristics,
29 final LanePerception perception, final CarFollowingModel carFollowingModel, final Desire mandatoryDesire,
30 final Desire voluntaryDesire) throws ParameterException, OperationalPlanException
31 {
32 if (mandatoryDesire.getRight() < 0 || voluntaryDesire.getRight() < 0)
33 {
34
35 return new Desire(0, 0);
36 }
37
38 return new Desire(0, behavioralCharacteristics.getParameter(LmrsUtil.DFREE));
39 }
40
41
42 @Override
43 public final String toString()
44 {
45 return "IncentiveKeep";
46 }
47
48 }