Class CarContainer
java.lang.Object
|
+--CarContainer
- Direct Known Subclasses:
- JunctionPath, LaneSection
- public abstract class CarContainer
- extends java.lang.Object
Constructor Summary |
CarContainer(int iD,
int startX,
int startY,
int endX,
int endY)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOTHING_IN_FRONT
public static final double NOTHING_IN_FRONT
CarContainer
public CarContainer(int iD,
int startX,
int startY,
int endX,
int endY)
getGradient
public double getGradient()
getdy
public double getdy()
getdx
public double getdx()
getstartX
public int getstartX()
getstartY
public int getstartY()
getendX
public int getendX()
getendY
public int getendY()
getRadAngle
public double getRadAngle()
getMidX
public int getMidX()
getMidY
public int getMidY()
getGeneralDirection
public int getGeneralDirection()
getID
public int getID()
isLastOne
public abstract boolean isLastOne()
onToNext
public abstract CarContainer onToNext()
getParentID
public abstract int getParentID()
isFirstOne
public boolean isFirstOne()
drawAllCars
public void drawAllCars(java.awt.Graphics2D g2d)
drawIDs
public void drawIDs(java.awt.Graphics2D g2d,
int parentID)
addCar
public void addCar(Car newCar)
removeCar
public void removeCar(Car newCar)
hasCars
public boolean hasCars()
anycollisions
public boolean anycollisions(Car currentcar)
getNextObInFront
public double[] getNextObInFront(Car currentcar,
double curCarDistFromEnd)
- given the front of the "currentcar", this returns the shortest distance
between the front of the "currentcar" and the back of the car in front.
isOKToGo
public double[] isOKToGo(Car c,
double[] info,
double dist)
numStationaryCars
public int numStationaryCars()
kill
public void kill()
getCar
public Car getCar(java.awt.geom.Point2D p)
- Due to mouse Events
getSpeeds
public int getSpeeds()