|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.vehicle.VehicleUtil
public class VehicleUtil
The utility functions for vehicles.
Method Summary | |
---|---|
static double |
calcDistanceIfAccel(double startVelocity,
double accel,
double targetVelocity,
double duration)
Determine how far the Vehicle will go in the given duration, if it starts at the given starting velocity and accelerates at the given acceleration toward the provided target velocity. |
static double |
calcDistanceToStop(double startingVelocity,
double maxDeceleration)
Get the amount of distance it will take to stop, given a starting velocity. |
static double |
distanceToCarInFront(AutoVehicleDriverView vehicle)
Calculate the distance to the Vehicle in front of this one, in meters. |
static double |
distanceToChangeBetween(double v0,
double vf,
double acc)
Calculate how much distance the Vehicle will cover while changing velocity. |
static double |
distanceToChangeBetween(double v0,
double vf,
double acc,
double dec)
Calculate how much distance the Vehicle will cover while changing velocity. |
static boolean |
intersects(VehicleSimView v,
Area area)
Determine whether the given Vehicle is currently inside an area |
static double |
maxTurnVelocity(VehicleSpec spec,
Lane arrivalLane,
Lane departureLane,
IntersectionManager im)
Get the maximum velocity that this Vehicle should make the turn between lanes through an intersection. |
static double |
maxVelocityToStopOverDistance(VehicleSpec spec,
double distance)
Calculate the maximum starting velocity for which the vehicle can stop within the given distance. |
static double |
minimumTimeToCover(double distance,
double startVelocity,
double topVelocity,
double acc)
Calculate the minimum amount of time, in seconds, it can take for the vehicle to cover the indicated distance, given a starting velocity and a top velocity allowed while covering the distance. |
static double |
timeToChangeBetween(double v0,
double vf,
double acc)
Calculate how much time the Vehicle will cover to change velocity with a given acceleration. |
static double |
timeToChangeBetween(double v0,
double vf,
double acc,
double dec)
Calculate how much time the Vehicle will cover to change velocity with a given acceleration and a given deceleration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double maxTurnVelocity(VehicleSpec spec, Lane arrivalLane, Lane departureLane, IntersectionManager im)
spec
- the vehicle's specificationarrivalLane
- the Lane from which the Vehicle is turningdepartureLane
- the Lane into which the Vehicle is turningim
- the IntersectionManager controlling the
intersection through which the Vehicle is making
the turn
public static double maxVelocityToStopOverDistance(VehicleSpec spec, double distance)
spec
- the vehicle specificationdistance
- the distance over which the Vehicle will be changing
velocity
public static double calcDistanceToStop(double startingVelocity, double maxDeceleration)
startingVelocity
- the velocity at which the Vehicle starts
deceleratingmaxDeceleration
- the maximum deceleration
public static double calcDistanceIfAccel(double startVelocity, double accel, double targetVelocity, double duration)
startVelocity
- the initial velocity of the Vehicleaccel
- the acceleration of the Vehicle during this
timetargetVelocity
- the velocity at which the Vehicle will stop
acceleratingduration
- the duration for which this all takes place
public static double timeToChangeBetween(double v0, double vf, double acc)
v0
- the initial velocity of the Vehiclevf
- the final velocity of the Vehicleacc
- the acceleration
public static double timeToChangeBetween(double v0, double vf, double acc, double dec)
v0
- the initial velocity of the Vehiclevf
- the final velocity of the Vehicleacc
- the accelerationdec
- the deceleration
public static double distanceToChangeBetween(double v0, double vf, double acc)
v0
- the initial velocity of the Vehiclevf
- the final velocity of the Vehicleacc
- the acceleration
public static double distanceToChangeBetween(double v0, double vf, double acc, double dec)
v0
- the initial velocity of the Vehiclevf
- the final velocity of the Vehicleacc
- the accelerationdec
- the deceleration
public static double minimumTimeToCover(double distance, double startVelocity, double topVelocity, double acc)
distance
- the distance to coverstartVelocity
- the velocity at the start of covering the distancetopVelocity
- the top allowed velocity while covering the distanceacc
- the acceleration
public static boolean intersects(VehicleSimView v, Area area)
v
- the Vehiclearea
- the area
public static double distanceToCarInFront(AutoVehicleDriverView vehicle)
vehicle
- the vehicle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |