aim4.map
Class TrafficVolume

java.lang.Object
  extended by aim4.map.TrafficVolume

public class TrafficVolume
extends Object

The record for traffic volume.


Constructor Summary
TrafficVolume(GridMap map, List<String> strs)
          Create a new traffic volume object from the data in a file.
 
Method Summary
 Road getLeftTurnRoad(Road road)
          Get the left turn volume of a road.
 double getLeftTurnVolume(int laneId)
          Get the left turn volume of a lane.
 Road getRightTurnRoad(Road road)
          Get the right turn volume of a road.
 double getRightTurnVolume(int laneId)
          Get the right turn volume of a lane.
 double getThroughVolume(int laneId)
          Get the left turn volume of a lane.
 double getTotalVolume(int laneId)
          Get the total volume of a lane.
static TrafficVolume makeFromFile(GridMap map, String csvFileName)
          Create a new traffic volume object from file.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrafficVolume

public TrafficVolume(GridMap map,
                     List<String> strs)
Create a new traffic volume object from the data in a file.

Parameters:
map - the map
strs - the data in a file
Method Detail

makeFromFile

public static TrafficVolume makeFromFile(GridMap map,
                                         String csvFileName)
Create a new traffic volume object from file.

Parameters:
map - the map
csvFileName - the file name of the CSV file
Returns:
the traffic volume object

getLeftTurnVolume

public double getLeftTurnVolume(int laneId)
Get the left turn volume of a lane.

Parameters:
laneId - the ID of the lane
Returns:
the left turn volume of the lane

getThroughVolume

public double getThroughVolume(int laneId)
Get the left turn volume of a lane.

Parameters:
laneId - the ID of the lane
Returns:
the left turn volume of the lane

getRightTurnVolume

public double getRightTurnVolume(int laneId)
Get the right turn volume of a lane.

Parameters:
laneId - the ID of the lane
Returns:
the right turn volume of the lane

getTotalVolume

public double getTotalVolume(int laneId)
Get the total volume of a lane.

Parameters:
laneId - the ID of the lane
Returns:
the total volume of the lane

getLeftTurnRoad

public Road getLeftTurnRoad(Road road)
Get the left turn volume of a road.

Parameters:
road - the road
Returns:
the left turn volume of the road

getRightTurnRoad

public Road getRightTurnRoad(Road road)
Get the right turn volume of a road.

Parameters:
road - the road
Returns:
the right turn volume of the road

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.