1 package org.opentrafficsim.road.gtu.lane.perception.object;
2
3 import java.util.Set;
4
5 import org.djunits.value.vdouble.scalar.Length;
6 import org.djutils.immutablecollections.ImmutableSet;
7 import org.opentrafficsim.core.gtu.GtuException;
8 import org.opentrafficsim.road.gtu.lane.perception.RelativeLane;
9 import org.opentrafficsim.road.network.lane.Lane;
10 import org.opentrafficsim.road.network.lane.object.BusStop;
11
12
13
14
15
16
17
18
19
20
21
22 public class PerceivedBusStop extends PerceivedLaneBasedObjectBase
23 {
24
25
26 private final RelativeLane relativeLane;
27
28
29 private final ImmutableSet<String> lines;
30
31
32 private final Set<String> conflictIds;
33
34
35
36
37
38
39
40
41
42
43 public PerceivedBusStop(final BusStop busStop, final Length distance, final RelativeLane relativeLane,
44 final Set<String> conflictIds, final Lane lane) throws GtuException
45 {
46 super(busStop.getId(), ObjectType.BUSSTOP, Length.ZERO, Kinematics.staticAhead(distance), lane);
47 this.relativeLane = relativeLane;
48 this.lines = busStop.getLines();
49 this.conflictIds = conflictIds;
50 }
51
52
53
54
55
56 public final RelativeLane getRelativeLane()
57 {
58 return this.relativeLane;
59 }
60
61
62
63
64
65 public final ImmutableSet<String> getLines()
66 {
67 return this.lines;
68 }
69
70
71
72
73
74 public final Set<String> getConflictIds()
75 {
76 return this.conflictIds;
77 }
78
79 @Override
80 public final String toString()
81 {
82 return "PerceivedBusStop [relativeLane=" + this.relativeLane + ", lines=" + this.lines + ", conflictIds="
83 + this.conflictIds + "]";
84 }
85
86 }