1 package org.opentrafficsim.road.gtu.lane.tactical.toledo;
2
3 import org.opentrafficsim.core.gtu.GTUException;
4 import org.opentrafficsim.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
5 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException;
6 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterTypes;
7 import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
8 import org.opentrafficsim.road.gtu.lane.tactical.LaneBasedTacticalPlannerFactory;
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public class ToledoFactory implements LaneBasedTacticalPlannerFactory<Toledo>
23 {
24
25
26 @Override
27 public final BehavioralCharacteristics getDefaultBehavioralCharacteristics()
28 {
29 BehavioralCharacteristics behavioralCharacteristics = new BehavioralCharacteristics();
30 try
31 {
32 behavioralCharacteristics.setDefaultParameter(ParameterTypes.LOOKAHEAD);
33
34 behavioralCharacteristics.setDefaultParameter(ParameterTypes.LOOKBACKOLD);
35 }
36 catch (ParameterException exception)
37 {
38
39 throw new RuntimeException(exception);
40 }
41 behavioralCharacteristics.setDefaultParameters(ToledoLaneChangeParameters.class);
42 behavioralCharacteristics.setDefaultParameters(ToledoCarFollowing.class);
43 behavioralCharacteristics.setDefaultParameters(Toledo.class);
44 return behavioralCharacteristics;
45 }
46
47
48 @Override
49 public final Toledo create(final LaneBasedGTU gtu) throws GTUException
50 {
51 return new Toledo(new ToledoCarFollowing(), gtu);
52 }
53
54
55 public final String toString()
56 {
57 return "ToledoFactory";
58 }
59
60 }