1
2
3
4
5
6
7
8
9
10
11 package nl.tudelft.simulation.traffic.controlpoint.blocks;
12
13 import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
14 import nl.tudelft.simulation.traffic.controlpoint.virtual.VirtualControlPoint;
15 import nl.tudelft.simulation.traffic.track.TrackInterface;
16 import nl.tudelft.simulation.traffic.vehicle.VehiclePhysicalInterface;
17
18 /***
19 * This class implements the virtual control points for the
20 * SwitchBlockTrafficLight <br>
21 * (c) copyright 2003-2004 <a href="http://www.simulation.tudelft.nl">Delft
22 * University of Technology </a>, the Netherlands. <br>
23 * See for project information <a href="http://www.simulation.tudelft.nl">
24 * www.simulation.tudelft.nl </a> <br>
25 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
26 * License (GPL) </a>, no warranty <br>
27 *
28 * @version May 31, 2004 <br>
29 * @author <a
30 * href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
31 * Verbraeck </a>
32 */
33 public class SwitchBlockControlPoint extends VirtualControlPoint
34 {
35 /*** object to call when sensor is triggered */
36 private SwitchBlockTrafficLight callBack;
37
38 /*** which sensor is this? */
39 private int sensor;
40
41 /***
42 * @param track
43 * @param progression
44 * @param callBack
45 * @param sensor
46 * @param simulator
47 */
48 public SwitchBlockControlPoint(final TrackInterface track,
49 final double progression, final SwitchBlockTrafficLight callBack,
50 final int sensor, final SimulatorInterface simulator)
51 {
52 super(track, progression, simulator);
53 this.callBack = callBack;
54 this.sensor = sensor;
55 }
56
57 /***
58 * @see nl.tudelft.simulation.traffic.controlpoint.ControlPointInterface#pass(nl.tudelft.simulation.traffic.vehicle.VehiclePhysicalInterface)
59 */
60 public void pass(final VehiclePhysicalInterface vehicle)
61 {
62 this.callBack.triggerSensor(this.sensor, vehicle);
63 }
64 }