All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----gerken.vehicles.VehicleNetwork
A VehicleNetwork represents a collection of NetworkNodes and NetworkConnections and implements a set of behavior appropriate to that collection. The properties of the nodes in a network as well as the way in which the nodes are connected are the basis for the behaviors exhibited by that network's simulation vehicle. The network class decribes the behavior that drives the interaction between nodes, connections and the "outside" simulation environment.
This software is provided on an as-is basis and is copyright Chris Gerken. The only rights granted to you are to enjoy and learn from this software.
Return a new vehicle network.
Register a connection to the network
Register a hidden node to the network.
Register a receptor to the network
Build and return a vehicle network that veers its vehicle away from white light.
Build and return a vehicle network that veers its vehicle toward a light colored c.
Build and return a vehicle network that travels straight ahead.
Return the network's descriptive name
Build and return a vehicle network that veers its vehicle toward a white light.
Build and return a vehicle network that follows others of its kind.
Return the registered node named name.
Return the equivalent angle (in radians, between + and - pi)
Build and return a vehicle network that orbits any c-colored light.
Build and return a vehicle network that veers its vehicle first toward and then away from a white light.
Set the network's desriptive name.
Specify the node to be connected to the vehicle's left wheel motor.
Specify the node to be connected to the vehicle's right wheel motor.
Build and return a vehicle network that veers its vehicle toward a white light.
public VehicleNetwork()
Return a new vehicle network.
public void addConnection(NetworkConnection vnc)
Register a connection to the network
public void addHiddenNode(HiddenNode node)
Register a hidden node to the network.
public void addReceptor(Receptor r)
Register a receptor to the network
public static VehicleNetwork blue()
Build and return a vehicle network that veers its vehicle away from white light.
public static VehicleNetwork chaser(Color c)
Build and return a vehicle network that veers its vehicle toward a light colored c. The chaser is a more efficient network than the yellow "network".
public static VehicleNetwork cruiser()
Build and return a vehicle network that travels straight ahead.
public String getDescription()
Return the network's descriptive name
public static VehicleNetwork green()
Build and return a vehicle network that veers its vehicle toward a white light.
public static VehicleNetwork lemming()
Build and return a vehicle network that follows others of its kind.
public NetworkNode nodeNamed(String name)
Return the registered node named name.
public double normalizeAngle(double angle)
Return the equivalent angle (in radians, between + and - pi)
public static VehicleNetwork orbiter(Color c)
Build and return a vehicle network that orbits any c-colored light.
public static VehicleNetwork red()
Build and return a vehicle network that veers its vehicle first toward and then away from a white light.
public void setDescription(String desc)
Set the network's desriptive name.
public void setLeftMotorNode(NetworkNode n)
Specify the node to be connected to the vehicle's left wheel motor. When this node fires, the vehicle will either move forward or turn right, depending on whether the right wheel motor did or did not also fire, respectively.
public void setRightMotorNode(NetworkNode n)
Specify the node to be connected to the vehicle's right wheel motor. When this node fires, the vehicle will either move forward or turn left, depending on whether the left wheel motor did or did not also fire, respectively.
public static VehicleNetwork yellow()
Build and return a vehicle network that veers its vehicle toward a white light.
All Packages Class Hierarchy This Package Previous Next Index