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

java.lang.Object
  extended bynl.tudelft.simulation.traffic.controlpoint.blocks.VirtualBlock
Direct Known Subclasses:
SwitchVirtualBlock, VirtualSwitchBlock

public class VirtualBlock
extends java.lang.Object

This class implements a virtual block that will be guarded by n SingleTrackBlockTrafficLights. Only one vehicle is allowed in the Block.

(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
protected  int busy
          busy shows the number of vehicles in the guarded block
 java.util.ArrayList requestList
          requestList shows the list of SwicthBlockTrafficLights that are requesting access to the block
 
Constructor Summary
VirtualBlock(java.lang.String name)
          Constructs a VirtualBlock
 
Method Summary
 java.lang.String getName()
           
 void releaseBlock()
          releaseBlock releases the block for other vehicles and check if there is any access request in the requesList
 void requestAccess(SwitchBlockTrafficLight switchBlockTrafficLight)
          requestAccess process the request to gain access to the block
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

busy

protected int busy
busy shows the number of vehicles in the guarded block


requestList

public java.util.ArrayList requestList
requestList shows the list of SwicthBlockTrafficLights that are requesting access to the block

Constructor Detail

VirtualBlock

public VirtualBlock(java.lang.String name)
Constructs a VirtualBlock

Parameters:
name - name of the VirtualBlock
Method Detail

requestAccess

public void requestAccess(SwitchBlockTrafficLight switchBlockTrafficLight)
requestAccess process the request to gain access to the block

Parameters:
switchBlockTrafficLight - the correpondent switchBlockTrafficLight that want to gain access to the block

releaseBlock

public void releaseBlock()
releaseBlock releases the block for other vehicles and check if there is any access request in the requesList


getName

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


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