aim4.driver.navigator
Class BasicNavigator

java.lang.Object
  extended by aim4.driver.navigator.BasicNavigator
All Implemented Interfaces:
Navigator

public class BasicNavigator
extends Object
implements Navigator

A base class for an agent that chooses which way a vehicle should go.


Constructor Summary
BasicNavigator(VehicleSpec vehicleSpec, BasicMap basicMap)
          Construct a new Navigator for the given Vehicle specification.
 
Method Summary
 Road navigate(Road current, IntersectionManager im, Road destination)
          Given the current Road, the IntersectionManager being approached, and a destination Road, find a road that leave the IntersectionManager that will lead to the destination Road.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicNavigator

public BasicNavigator(VehicleSpec vehicleSpec,
                      BasicMap basicMap)
Construct a new Navigator for the given Vehicle specification. This will only be called by derived classes.

Parameters:
vehicleSpec - the vehicle's specification
basicMap - the map object
Method Detail

navigate

public Road navigate(Road current,
                     IntersectionManager im,
                     Road destination)
Given the current Road, the IntersectionManager being approached, and a destination Road, find a road that leave the IntersectionManager that will lead to the destination Road.

Specified by:
navigate in interface Navigator
Parameters:
current - the Road on which the vehicle is currently traveling
im - the IntersectionManager the vehicle is approaching
destination - the Road on which the vehicle would ultimately like to end up
Returns:
a road to take out of the intersection governed by the given IntersectionManager


Copyright © 2011. All Rights Reserved.