aim4.vehicle
Class BasicVehicle.PhysicalMovement

java.lang.Object
  extended by aim4.vehicle.BasicVehicle.PhysicalMovement
All Implemented Interfaces:
BasicVehicle.Movement, BasicVehicle.MovementWithAccel
Direct Known Subclasses:
BasicVehicle.MoveToTargetVelocityMovement
Enclosing class:
BasicVehicle

public static class BasicVehicle.PhysicalMovement
extends Object
implements BasicVehicle.MovementWithAccel

The physical movement.


Field Summary
protected  VehicleSpec spec
          The specification of the vehicle
 
Constructor Summary
BasicVehicle.PhysicalMovement(BasicVehicle.NonAccelMovement nonAccelMovement, double acceleration)
          Create the physical movement.
 
Method Summary
 void coast()
          Maintain the speed of the vehicle.
 double getAcceleration()
          Get the acceleration of the vehicle
 double getHeading()
          Get the heading of the vehicle
 BasicVehicle.NonAccelMovement getNonAccelMovement()
          Get the non acceleration movement.
 Point2D getPosition()
          Get the position of the vehicle.
 double getVelocity()
          Get the velocity of the vehicle
 void move(double currentTime, double timeStep)
          Move the vehicle for a given period of time.
protected  void moveWithoutAcceleration(double currentTime, double timeStep)
          Move the vehicle while holding all vehicle properties, including the acceleration, constant.
 void setAccelerationWithBound(double acceleration)
          Set the acceleration with respect to the physical limit of the vehicle.
protected  void setVelocityWithBound(double velocity)
          Set the velocity with respect to the physical limit of the vehicle.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

spec

protected final VehicleSpec spec
The specification of the vehicle

Constructor Detail

BasicVehicle.PhysicalMovement

public BasicVehicle.PhysicalMovement(BasicVehicle.NonAccelMovement nonAccelMovement,
                                     double acceleration)
Create the physical movement.

Parameters:
nonAccelMovement - the non-acceleration movement
acceleration - the acceleration
Method Detail

getPosition

public Point2D getPosition()
Get the position of the vehicle.

Specified by:
getPosition in interface BasicVehicle.Movement
Returns:
the position of the vehicle

getHeading

public double getHeading()
Get the heading of the vehicle

Specified by:
getHeading in interface BasicVehicle.Movement
Returns:
the heading of the vehicle

getVelocity

public double getVelocity()
Get the velocity of the vehicle

Specified by:
getVelocity in interface BasicVehicle.Movement
Returns:
the velocity of the vehicle

getAcceleration

public double getAcceleration()
Get the acceleration of the vehicle

Specified by:
getAcceleration in interface BasicVehicle.MovementWithAccel
Returns:
the acceleration of the vehicle

getNonAccelMovement

public BasicVehicle.NonAccelMovement getNonAccelMovement()
Get the non acceleration movement.

Returns:
the non acceleration movement

setAccelerationWithBound

public void setAccelerationWithBound(double acceleration)
Set the acceleration with respect to the physical limit of the vehicle.

Specified by:
setAccelerationWithBound in interface BasicVehicle.MovementWithAccel
Parameters:
acceleration - the acceleration

coast

public void coast()
Maintain the speed of the vehicle.


move

public void move(double currentTime,
                 double timeStep)
Move the vehicle for a given period of time.

Specified by:
move in interface BasicVehicle.Movement
Parameters:
currentTime - the current time
timeStep - the period of time for which the vehicle moves.

moveWithoutAcceleration

protected void moveWithoutAcceleration(double currentTime,
                                       double timeStep)
Move the vehicle while holding all vehicle properties, including the acceleration, constant.

Parameters:
currentTime - the current time
timeStep - the length of time for which to move the Vehicle

setVelocityWithBound

protected void setVelocityWithBound(double velocity)
Set the velocity with respect to the physical limit of the vehicle.

Parameters:
velocity - the velocity

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.