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

java.lang.Object
  extended bynl.tudelft.simulation.traffic.controlpoint.blocks.VirtualBlock
      extended bynl.tudelft.simulation.traffic.controlpoint.blocks.VirtualSwitchBlock

public class VirtualSwitchBlock
extends VirtualBlock

The VirtualSwitchBlock defines the block to be guarded including the turning of a switch, depending on the 'line' attribute of the vehicleControl.

(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:
Jun 20, 2004
Author:
Alexander Verbraeck

Field Summary
 
Fields inherited from class nl.tudelft.simulation.traffic.controlpoint.blocks.VirtualBlock
busy, requestList
 
Constructor Summary
VirtualSwitchBlock(java.lang.String name, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator, nl.tudelft.simulation.jstats.distributions.DistContinuous switchTime)
          constucts a new VirtualSwitchBlock
 
Method Summary
 void addSwitchDirection(SwitchBlockTrafficLight trafficLight, java.util.List lineList, double distanceRelease, TrackInterface fromTrack, TrackInterface toTrack)
          adds a list of direction to the block for each line
 void requestAccess(SwitchBlockTrafficLight switchBlockTrafficLight)
          requestAcess process the request to access a SwitchBlock
protected  void turnSwitch(TrackLinkInterface startLink, TrackInterface fromTrack, TrackInterface toTrack, SwitchBlockTrafficLight switchBlockTrafficLight)
          turnSwitch turns the switch to the position from fromTrack to toTrack
 
Methods inherited from class nl.tudelft.simulation.traffic.controlpoint.blocks.VirtualBlock
getName, releaseBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualSwitchBlock

public VirtualSwitchBlock(java.lang.String name,
                          nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator,
                          nl.tudelft.simulation.jstats.distributions.DistContinuous switchTime)
constucts a new VirtualSwitchBlock

Parameters:
name - the name of the VirtualSwitchBlock
simulator -
switchTime -
Method Detail

addSwitchDirection

public void addSwitchDirection(SwitchBlockTrafficLight trafficLight,
                               java.util.List lineList,
                               double distanceRelease,
                               TrackInterface fromTrack,
                               TrackInterface toTrack)
adds a list of direction to the block for each line

Parameters:
trafficLight - guarding the block
lineList - list of lines that will use the direction to be set
distanceRelease - distance after the traffic light that the block will be released for other vehicles
fromTrack - start track to set the direction of the switch
toTrack - end track to set the direction of the switch

requestAccess

public void requestAccess(SwitchBlockTrafficLight switchBlockTrafficLight)
requestAcess process the request to access a SwitchBlock

Overrides:
requestAccess in class VirtualBlock
Parameters:
switchBlockTrafficLight - correspondent switchBlockTrafficLight that request access to the block

turnSwitch

protected void turnSwitch(TrackLinkInterface startLink,
                          TrackInterface fromTrack,
                          TrackInterface toTrack,
                          SwitchBlockTrafficLight switchBlockTrafficLight)
turnSwitch turns the switch to the position from fromTrack to toTrack

Parameters:
startLink - start link of the switch
fromTrack - track before the switch
toTrack - track to where the switch needs to be positioned
switchBlockTrafficLight -


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