1 package org.opentrafficsim.demo.carFollowing;
2
3 import java.lang.reflect.Field;
4 import java.util.Set;
5
6 import nl.tudelft.simulation.language.reflection.ClassUtil;
7
8 import org.djunits.unit.LengthUnit;
9 import org.djunits.value.vdouble.scalar.Length;
10 import org.opentrafficsim.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
11 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException;
12 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterType;
13 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterTypeBoolean;
14 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterTypeDouble;
15 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterTypeInteger;
16 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterTypes;
17
18
19
20
21
22
23
24
25
26
27
28
29
30 public final class DefaultsFactory
31 {
32
33
34
35
36 private DefaultsFactory()
37 {
38
39 }
40
41
42
43
44
45 public static BehavioralCharacteristics getDefaultBehavioralCharacteristics()
46 {
47
48 BehavioralCharacteristics bc = new BehavioralCharacteristics().setDefaultParameters(ParameterTypes.class);
49
50
51 try
52 {
53 bc.setParameter(ParameterTypes.LOOKAHEAD, new Length(250, LengthUnit.SI));
54 }
55 catch (ParameterException pe)
56 {
57 throw new RuntimeException("Parameter type 'LOOKAHEAD' could not be set.", pe);
58 }
59
60 return bc;
61
62 }
63
64 }