aim4.map
Class SpawnPoint

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

public class SpawnPoint
extends Object

A spawn point.


Nested Class Summary
static class SpawnPoint.SpawnSpec
          The specification of a spawn.
static interface SpawnPoint.SpawnSpecGenerator
          The interface of the spawn specification genreator.
 
Constructor Summary
SpawnPoint(double currentTime, Point2D pos, double heading, double steeringAngle, double acceleration, Lane lane, Rectangle2D noVehicleZone)
          Create a spawn point.
SpawnPoint(double currentTime, Point2D pos, double heading, double steeringAngle, double acceleration, Lane lane, Rectangle2D noVehicleZone, SpawnPoint.SpawnSpecGenerator vehicleSpecChooser)
          Create a spawn point.
 
Method Summary
 List<SpawnPoint.SpawnSpec> act(double timeStep)
          Advance the time step.
 double getAcceleration()
          Get the initial acceleration.
 double getCurrentTime()
          Get the current time.
 double getHeading()
          Get the initial heading.
 Lane getLane()
          Get the lane.
 Rectangle2D getNoVehicleZone()
          Get the no vehicle zone.
 Point2D getPosition()
          Get the initial position.
 double getSteeringAngle()
          Get the initial steering angle.
 void setVehicleSpecChooser(SpawnPoint.SpawnSpecGenerator vehicleSpecChooser)
          Set the vehicle spec chooser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpawnPoint

public SpawnPoint(double currentTime,
                  Point2D pos,
                  double heading,
                  double steeringAngle,
                  double acceleration,
                  Lane lane,
                  Rectangle2D noVehicleZone,
                  SpawnPoint.SpawnSpecGenerator vehicleSpecChooser)
Create a spawn point.

Parameters:
currentTime - the current time
pos - the initial position
heading - the initial heading
steeringAngle - the initial steering angle
acceleration - the initial acceleration
lane - the lane
noVehicleZone - the no vehicle zone
vehicleSpecChooser - the vehicle spec chooser

SpawnPoint

public SpawnPoint(double currentTime,
                  Point2D pos,
                  double heading,
                  double steeringAngle,
                  double acceleration,
                  Lane lane,
                  Rectangle2D noVehicleZone)
Create a spawn point.

Parameters:
currentTime - the current time
pos - the initial position
heading - the initial heading
steeringAngle - the initial steering angle
acceleration - the initial acceleration
lane - the lane
noVehicleZone - the no vehicle zone
Method Detail

act

public List<SpawnPoint.SpawnSpec> act(double timeStep)
Advance the time step.

Parameters:
timeStep - the time step
Returns:
The list of spawn spec generated in this time step

getCurrentTime

public double getCurrentTime()
Get the current time.

Returns:
the current time

getPosition

public Point2D getPosition()
Get the initial position.

Returns:
the initial position

getHeading

public double getHeading()
Get the initial heading.

Returns:
the initial heading

getSteeringAngle

public double getSteeringAngle()
Get the initial steering angle.

Returns:
the initial steering angle

getAcceleration

public double getAcceleration()
Get the initial acceleration.

Returns:
the initial acceleration

getLane

public Lane getLane()
Get the lane.

Returns:
the lane

getNoVehicleZone

public Rectangle2D getNoVehicleZone()
Get the no vehicle zone.

Returns:
the no vehicle zone

setVehicleSpecChooser

public void setVehicleSpecChooser(SpawnPoint.SpawnSpecGenerator vehicleSpecChooser)
Set the vehicle spec chooser.

Parameters:
vehicleSpecChooser - the vehicle spec chooser


Copyright © 2011. All Rights Reserved.