public class BasicAutoVehicle extends BasicVehicle implements AutoVehicleSimView
BasicVehicle.AccelScheduleMovement, BasicVehicle.Movement, BasicVehicle.MovementFactory, BasicVehicle.MovementWithAccel, BasicVehicle.MoveToTargetVelocityMovement, BasicVehicle.NonAccelMovement, BasicVehicle.PhysicalMovement, BasicVehicle.SteeringMovement, BasicVehicle.TrackMovementAutoVehicleDriverView.LRFMode| Modifier and Type | Field and Description |
|---|---|
protected int |
bitsReceived
The number of bits this Vehicle has received.
|
static double |
DEFAULT_TRANSMISSION_POWER
The default distance the Vehicle can transmit messages.
|
currentTime, movement, spec, vin| Constructor and Description |
|---|
BasicAutoVehicle(VehicleSpec spec,
Point2D pos,
double heading,
double steeringAngle,
double velocity,
double targetVelocity,
double acceleration,
double currentTime)
Construct a vehicle
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBitsReceived()
Get the number of bits this Vehicle has received.
|
int |
getBitsTransmitted()
Get the number of bits this Vehicle has transmitted.
|
AutoDriver |
getDriver()
Getter method for the Driver controlling this Vehicle.
|
DoubleGauge |
getFrontVehicleDistanceSensor()
Get this Vehicle's gauge of sensors about the distance, in meters,
between p1 and p2, both of them are points on the target lane,
where p1 is the point projected from the center of the front of the
vehicle, and p2 is the nearest point of another vehicle in the front
of the vehicle to p1 on the target lane.
|
DoubleGauge |
getFrontVehicleSpeedSensor()
Get this Vehicle's gauge of sensors about the speed, in meters per second,
of the vehicle in front of the vehicle on the target lane.
|
DoubleGauge |
getIntervalometer()
Get this Vehicle's interval-to-vehicle-in-front gauge.
|
V2IMessage |
getLastV2IMessage()
Get the last V2I message
|
DoubleGauge |
getLRFAngle()
Get this Vehicle's laser range finder angle gauge.
|
DoubleGauge |
getLRFDistance()
Get this Vehicle's laser range finder distance gauge.
|
AutoVehicleDriverView.LRFMode |
getLRFMode()
Get the Vehicle's laser range finder operating mode.
|
DoubleGauge |
getRearVehicleDistanceSensor()
Get this Vehicle's gauge of sensors about the distance, in meters,
between p1 and p2, both of them are points on the target lane,
where p1 is the point projected from the center of the front of the
vehicle, and p2 is the nearest point of another vehicle behind
the vehicle to p1 on the target lane.
|
DoubleGauge |
getRearVehicleSpeedSensor()
Get this Vehicle's gauge of sensors about the speed, in meters per second,
of the vehicle behind the vehicle on the target lane.
|
Lane |
getTargetLaneForVehicleTracking()
Return the target lane for vehicle tracking.
|
double |
getTransmissionPower()
Get the Vehicle's transmission power.
|
Queue<V2IMessage> |
getV2IOutbox()
Get the queue of V2I messages waiting to be delivered from this
Vehicle.
|
boolean |
isLRFSensing()
Get whether or not the laser range finder is sensing anything.
|
boolean |
isVehicleTracking()
Get whether or not the vehicle tracking sensors are sensing anything.
|
List<I2VMessage> |
pollAllMessagesFromI2VInbox()
Get the list of all messages currently in the queue of I2V messages
waiting to be read by this Vehicle.
|
void |
receive(I2VMessage msg)
Adds a message to the incoming queue of messages received from
IntersectionManagers.
|
void |
send(V2IMessage msg)
Adds a message to the outgoing queue of messages to be delivered to an
IntersectionManager.
|
void |
setDriver(AutoDriver driver)
Set this Vehicle's Driver.
|
void |
setLRFMode(AutoVehicleDriverView.LRFMode mode)
Set the Vehicle's laser range finder operating mode.
|
void |
setLRFSensing(boolean sensing)
Set whether or not the laser range finder is sensing anything.
|
void |
setTargetLaneForVehicleTracking(Lane lane)
Set the target lane for vehicle tracking.
|
void |
setTransmissionPower(double transmissionPower)
Set the Vehicle's transmission power.
|
void |
setVehicleTracking(boolean sensing)
Set whether or not the vehicle tracking sensors are sensing anything.
|
checkCurrentTime, coast, finalize, gaugeCornerPoints, gaugeHeading, gaugePointAtMiddleFront, gaugePointAtRear, gaugePointBetweenFrontWheels, gaugePosition, gaugeRearLeftCornerPoint, gaugeRearRightCornerPoint, gaugeShape, gaugeTime, gaugeVelocity, getAcceleration, getAccelSchedule, getCenterPoint, getCornerPoints, getEdges, getHeading, getPointAtMiddleFront, getPointAtRear, getPosition, getShape, getShape, getSpec, getSteeringAngle, getVelocity, getVIN, getWheelShapes, move, printState, removeAccelSchedule, setAccelSchedule, setAccelWithMaxTargetVelocity, setMaxAccelWithMaxTargetVelocity, setTargetVelocityWithMaxAccel, setVIN, slowToStop, turnTowardPointclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckCurrentTime, getAcceleration, getCenterPoint, getCornerPoints, getEdges, getHeading, getPointAtMiddleFront, getPointAtRear, getPosition, getShape, getShape, getVelocity, getWheelShapes, move, setVINcoast, gaugeHeading, gaugePointAtMiddleFront, gaugePointAtRear, gaugePointBetweenFrontWheels, gaugePosition, gaugeRearLeftCornerPoint, gaugeRearRightCornerPoint, gaugeShape, gaugeTime, gaugeVelocity, getAccelSchedule, getSpec, getVIN, printState, removeAccelSchedule, setAccelSchedule, setAccelWithMaxTargetVelocity, setTargetVelocityWithMaxAccel, slowToStop, turnTowardPointpublic static final double DEFAULT_TRANSMISSION_POWER
protected int bitsReceived
public BasicAutoVehicle(VehicleSpec spec, Point2D pos, double heading, double steeringAngle, double velocity, double targetVelocity, double acceleration, double currentTime)
spec - the vehicle's specificationpos - the initial position of the Vehicleheading - the initial heading of the VehiclesteeringAngle - the initial steering angle of the Vehiclevelocity - the initial velocity of the VehicletargetVelocity - the initial target velocityacceleration - the initial acceleration of the VehiclecurrentTime - the current timepublic AutoDriver getDriver()
getDriver in interface AutoVehicleDriverViewgetDriver in interface VehicleDriverViewgetDriver in class BasicVehiclenull
if none exists.public void setDriver(AutoDriver driver)
setDriver in interface VehicleSimViewdriver - the new driver to control this Vehiclepublic DoubleGauge getIntervalometer()
read, except in
the actual physical simulator which is allowed to set these values.getIntervalometer in interface AutoVehicleDriverViewpublic void setLRFMode(AutoVehicleDriverView.LRFMode mode)
mode - the new laser range finder modeAutoVehicleDriverView.LRFModepublic AutoVehicleDriverView.LRFMode getLRFMode()
getLRFMode in interface AutoVehicleDriverViewAutoVehicleDriverView.LRFModepublic boolean isLRFSensing()
isLRFSensing in interface AutoVehicleDriverViewpublic void setLRFSensing(boolean sensing)
setLRFSensing in interface AutoVehicleSimViewsensing - whether or not the laser range finder is sensing anythingpublic DoubleGauge getLRFAngle()
read,
except in the actual physical simulator which is allowed to set
these values.public DoubleGauge getLRFDistance()
read,
except in the actual physical simulator which is allowed to set
these values.getLRFDistance in interface AutoVehicleDriverViewpublic boolean isVehicleTracking()
isVehicleTracking in interface AutoVehicleDriverViewpublic void setVehicleTracking(boolean sensing)
setVehicleTracking in interface AutoVehicleDriverViewsensing - whether or not the vehicle tracking sensors are sensing
anythingpublic void setTargetLaneForVehicleTracking(Lane lane)
setTargetLaneForVehicleTracking in interface AutoVehicleDriverViewlane - the target lane for vehicle trackingpublic Lane getTargetLaneForVehicleTracking()
getTargetLaneForVehicleTracking in interface AutoVehicleDriverViewpublic DoubleGauge getFrontVehicleDistanceSensor()
getFrontVehicleDistanceSensor in interface AutoVehicleDriverViewpublic DoubleGauge getRearVehicleDistanceSensor()
getRearVehicleDistanceSensor in interface AutoVehicleDriverViewpublic DoubleGauge getFrontVehicleSpeedSensor()
getFrontVehicleSpeedSensor in interface AutoVehicleDriverViewpublic DoubleGauge getRearVehicleSpeedSensor()
getRearVehicleSpeedSensor in interface AutoVehicleDriverViewpublic void setTransmissionPower(double transmissionPower)
transmissionPower - the new transmission power, in meterspublic double getTransmissionPower()
getTransmissionPower in interface AutoVehicleDriverViewpublic Queue<V2IMessage> getV2IOutbox()
getV2IOutbox in interface VehicleSimViewpublic List<I2VMessage> pollAllMessagesFromI2VInbox()
pollAllMessagesFromI2VInbox in interface AutoVehicleDriverViewpublic void send(V2IMessage msg)
send in interface AutoVehicleDriverViewmsg - the message to send to an IntersectionManagerpublic void receive(I2VMessage msg)
receive in interface AutoVehicleDriverViewmsg - the message to send to another Vehiclepublic int getBitsReceived()
getBitsReceived in interface AutoVehicleDriverViewpublic int getBitsTransmitted()
getBitsTransmitted in interface AutoVehicleDriverViewpublic V2IMessage getLastV2IMessage()
getLastV2IMessage in interface AutoVehicleDriverViewCopyright © 2013. All rights reserved.