aim4.driver.navigator
Class BasicNavigator
java.lang.Object
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.
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 |
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 specificationbasicMap
- the map object
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 travelingim
- the IntersectionManager the vehicle is approachingdestination
- 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.