aim4.map
Class DataCollectionLine

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

public class DataCollectionLine
extends Object

The data collection line.


Constructor Summary
DataCollectionLine(String name, int id, Point2D p1, Point2D p2, boolean isNoRepeat)
          Create a data collection line.
 
Method Summary
 Set<Integer> getAllVIN()
          Get the VINs of all vehicles.
 int getId()
          Get the ID of the line.
 String getName()
          Get the name of the line.
 Shape getShape()
          Get the shape of the line.
 List<Double> getTimes(int vin)
          Get the time a vehicle passing through the line.
 boolean intersect(VehicleSimView v, double time, Point2D p1, Point2D p2)
          Whether the vehicle intersects the line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataCollectionLine

public DataCollectionLine(String name,
                          int id,
                          Point2D p1,
                          Point2D p2,
                          boolean isNoRepeat)
Create a data collection line.

Parameters:
name - the name of the data collection line
id - the ID of the line
p1 - the first point of the line
p2 - the second point of the line
isNoRepeat - Whether vehicles should not be counted more than once when it passes through the line more than once within the NO_REPEAT_TIME_PERIOD.
Method Detail

getShape

public Shape getShape()
Get the shape of the line.

Returns:
the shape of the line

intersect

public boolean intersect(VehicleSimView v,
                         double time,
                         Point2D p1,
                         Point2D p2)
Whether the vehicle intersects the line.

Parameters:
v - the vehicle
time - the current time
p1 - the first point of the vehicle
p2 - the second point of the vehicle
Returns:
whether the vehicle intersects the line

getName

public String getName()
Get the name of the line.

Returns:
the name of the line

getId

public int getId()
Get the ID of the line.

Returns:
the ID of the line

getAllVIN

public Set<Integer> getAllVIN()
Get the VINs of all vehicles.

Returns:
the VINs of all vehicles

getTimes

public List<Double> getTimes(int vin)
Get the time a vehicle passing through the line.

Parameters:
vin - the VIN of the vehicle
Returns:
the time the vehicle passing through the line


Copyright © 2011. All Rights Reserved.