nl.tudelft.simulation.traffic.controlpoint.blocks
Class SwitchBlockTrafficLight

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.traffic.controlpoint.real.AbstractVisibleControlPoint
          extended bynl.tudelft.simulation.traffic.controlpoint.blocks.SwitchBlockTrafficLight
All Implemented Interfaces:
Changeable, ControlPointInterface, nl.tudelft.simulation.event.EventProducerInterface, nl.tudelft.simulation.dsol.animation.LocatableInterface, java.io.Serializable, StopSignInterface, VisibleControlPointInterface

public class SwitchBlockTrafficLight
extends AbstractVisibleControlPoint
implements nl.tudelft.simulation.dsol.animation.LocatableInterface, StopSignInterface

This class implements the BlockTrafficLights that guards the switch
(c) copyright 2003-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Version:
May 31, 2004
Author:
Elisangela Kanacilo
See Also:
Serialized Form

Field Summary
static int SENSOR_RED
          RED sensor
static int SENSOR_RELEASE
          RELEASE sensor
static int SENSOR_REQUEST
          REQUEST sensor
static java.lang.String[] sensorNames
          sensor names
static java.lang.String STATE_BLACK
          BLACK state
static java.lang.String STATE_GREEN
          GREEN state
static java.lang.String STATE_RED
          RED state
 
Fields inherited from class nl.tudelft.simulation.traffic.controlpoint.real.AbstractVisibleControlPoint
progression, track
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.traffic.controlpoint.real.StopSignInterface
CONTINUE, STOP
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Fields inherited from interface nl.tudelft.simulation.traffic.controlpoint.ControlPointInterface
BACK, FRONT
 
Fields inherited from interface nl.tudelft.simulation.traffic.controlpoint.real.Changeable
CHANGE_STATUS_EVENT
 
Constructor Summary
SwitchBlockTrafficLight(java.lang.String name, TrackInterface track, double progression, VirtualBlock virtualBlock, double visibleDistance, double distanceRequest, double distanceRed, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator, double dx, double dy)
           
 
Method Summary
 void addSensors(TrackInterface track, double progression, int sensor, java.lang.String line, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator)
          Add sensors according to the line.
protected  void changeState(java.lang.String newState)
           
 javax.media.j3d.Bounds getBounds()
           
 java.lang.String getCurrentState()
           
 double getDistanceRed()
           
 double getDistanceRelease()
           
 double getDistanceRequest()
           
 nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
           
 java.lang.String getName()
           
 VehiclePhysicalInterface getRequestingVehicle()
           
 java.lang.String getStatus()
           
 VirtualBlock getVirtualBlock()
           
 void pass(VehiclePhysicalInterface vehicle)
          This method handles actions of the controlPoint when the controlPoint is passed by a vehicle.
 void setCurrentState(java.lang.String state)
           
 void setDistanceRelease(double distanceRelease)
          sets the distanceRelease.
 void setRequestingVehicle(VehiclePhysicalInterface requestingVehicle)
           
 java.lang.String toString()
           
 void triggerSensor(int sensor, VehiclePhysicalInterface vehicle)
           
 
Methods inherited from class nl.tudelft.simulation.traffic.controlpoint.real.AbstractVisibleControlPoint
getProgression, getTrack, getVisibleDistance
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypes, removeListener
 
Methods inherited from interface nl.tudelft.simulation.traffic.controlpoint.real.VisibleControlPointInterface
getVisibleDistance
 
Methods inherited from interface nl.tudelft.simulation.traffic.controlpoint.ControlPointInterface
getProgression, getTrack
 

Field Detail

STATE_GREEN

public static final java.lang.String STATE_GREEN
GREEN state

See Also:
Constant Field Values

STATE_RED

public static final java.lang.String STATE_RED
RED state

See Also:
Constant Field Values

STATE_BLACK

public static final java.lang.String STATE_BLACK
BLACK state

See Also:
Constant Field Values

SENSOR_REQUEST

public static final int SENSOR_REQUEST
REQUEST sensor

See Also:
Constant Field Values

SENSOR_RED

public static final int SENSOR_RED
RED sensor

See Also:
Constant Field Values

SENSOR_RELEASE

public static final int SENSOR_RELEASE
RELEASE sensor

See Also:
Constant Field Values

sensorNames

public static final java.lang.String[] sensorNames
sensor names

Constructor Detail

SwitchBlockTrafficLight

public SwitchBlockTrafficLight(java.lang.String name,
                               TrackInterface track,
                               double progression,
                               VirtualBlock virtualBlock,
                               double visibleDistance,
                               double distanceRequest,
                               double distanceRed,
                               nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator,
                               double dx,
                               double dy)
Parameters:
name -
track -
progression -
virtualBlock -
visibleDistance -
distanceRequest -
distanceRed -
simulator -
dx -
dy -
Method Detail

addSensors

public void addSensors(TrackInterface track,
                       double progression,
                       int sensor,
                       java.lang.String line,
                       nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator)
Add sensors according to the line. It is used only for adding Release Sensors for the block

Parameters:
track -
progression -
sensor -
line -
simulator -

triggerSensor

public void triggerSensor(int sensor,
                          VehiclePhysicalInterface vehicle)
Parameters:
sensor -
vehicle -

changeState

protected void changeState(java.lang.String newState)
Parameters:
newState -

pass

public void pass(VehiclePhysicalInterface vehicle)
Description copied from interface: ControlPointInterface
This method handles actions of the controlPoint when the controlPoint is passed by a vehicle.

Specified by:
pass in interface ControlPointInterface
Parameters:
vehicle - that triggers the controlPoint
See Also:
ControlPointInterface.pass(nl.tudelft.simulation.traffic.vehicle.VehiclePhysicalInterface)

getLocation

public nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
                                                            throws java.rmi.RemoteException
Specified by:
getLocation in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
Overrides:
getLocation in class AbstractVisibleControlPoint
Throws:
java.rmi.RemoteException
See Also:
LocatableInterface.getLocation()

getBounds

public javax.media.j3d.Bounds getBounds()
                                 throws java.rmi.RemoteException
Specified by:
getBounds in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
Overrides:
getBounds in class AbstractVisibleControlPoint
Throws:
java.rmi.RemoteException
See Also:
LocatableInterface.getBounds()

getCurrentState

public java.lang.String getCurrentState()
Returns:
Returns the currentState.

setCurrentState

public void setCurrentState(java.lang.String state)
Parameters:
state -

getStatus

public java.lang.String getStatus()
Specified by:
getStatus in interface Changeable
Returns:
status
See Also:
Changeable.getStatus()

toString

public java.lang.String toString()
See Also:
Object.toString()

getVirtualBlock

public VirtualBlock getVirtualBlock()
Returns:
Returns the virtualBlock.

getDistanceRed

public double getDistanceRed()
Returns:
Returns the distanceRed.

getDistanceRelease

public double getDistanceRelease()
Returns:
Returns the distanceRelease.

setDistanceRelease

public void setDistanceRelease(double distanceRelease)
sets the distanceRelease. This parameter need to be changed when the switch changes its direction

Parameters:
distanceRelease - distance after the SwitchBlockTrafficLight that the block will be released

getDistanceRequest

public double getDistanceRequest()
Returns:
Returns the distanceRequest.

getName

public java.lang.String getName()
Returns:
Returns the name.

getRequestingVehicle

public VehiclePhysicalInterface getRequestingVehicle()
Returns:
Returns the requestingVehicle.

setRequestingVehicle

public void setRequestingVehicle(VehiclePhysicalInterface requestingVehicle)
Parameters:
requestingVehicle - The requestingVehicle to set.


Copyright © 2003-2004 Delft University of Technology, the Netherlands. All Rights Reserved.