1 package org.opentrafficsim.road.gtu.lane.tactical.directedlanechange;
2
3 import org.djunits.unit.AccelerationUnit;
4 import org.djunits.value.vdouble.scalar.Acceleration;
5 import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
6 import org.opentrafficsim.road.gtu.lane.tactical.following.DualAccelerationStep;
7
8
9
10
11
12
13
14
15
16
17
18 public class DirectedAltruistic extends AbstractDirectedLaneChangeModel
19 {
20
21
22
23 public DirectedAltruistic(final LanePerception perception)
24 {
25 super(perception);
26 }
27
28
29 @Override
30 public final Acceleration applyDriverPersonality(final DualAccelerationStep accelerationSteps)
31 {
32
33
34
35
36 AccelerationUnit unit = accelerationSteps.getLeaderAcceleration().getUnit();
37 return new Acceleration((accelerationSteps.getLeaderAcceleration().getInUnit()
38 + accelerationSteps.getFollowerAcceleration().getInUnit(unit)) / 2, unit);
39 }
40
41
42 @Override
43 public final String getName()
44 {
45 return "Altruistic";
46 }
47
48
49 @Override
50 public final String getLongName()
51 {
52 return "Altruistic lane change model (as described by Treiber).";
53 }
54
55
56 @Override
57 public final String toString()
58 {
59 return "DirectedAltruistic [name=" + getName() + "]";
60 }
61
62 }