All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gerken.vehicles.VehicleNetwork

java.lang.Object
   |
   +----gerken.vehicles.VehicleNetwork

public class VehicleNetwork
extends Object

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.


Constructor Index

 o VehicleNetwork()

Return a new vehicle network.

Method Index

 o addConnection(NetworkConnection)

Register a connection to the network

 o addHiddenNode(HiddenNode)

Register a hidden node to the network.

 o addReceptor(Receptor)

Register a receptor to the network

 o blue()

Build and return a vehicle network that veers its vehicle away from white light.

 o chaser(Color)

Build and return a vehicle network that veers its vehicle toward a light colored c.

 o cruiser()

Build and return a vehicle network that travels straight ahead.

 o getDescription()

Return the network's descriptive name

 o green()

Build and return a vehicle network that veers its vehicle toward a white light.

 o lemming()

Build and return a vehicle network that follows others of its kind.

 o nodeNamed(String)

Return the registered node named name.

 o normalizeAngle(double)

Return the equivalent angle (in radians, between + and - pi)

 o orbiter(Color)

Build and return a vehicle network that orbits any c-colored light.

 o red()

Build and return a vehicle network that veers its vehicle first toward and then away from a white light.

 o setDescription(String)

Set the network's desriptive name.

 o setLeftMotorNode(NetworkNode)

Specify the node to be connected to the vehicle's left wheel motor.

 o setRightMotorNode(NetworkNode)

Specify the node to be connected to the vehicle's right wheel motor.

 o yellow()

Build and return a vehicle network that veers its vehicle toward a white light.

Constructors

 o VehicleNetwork
 public VehicleNetwork()

Return a new vehicle network.

Methods

 o addConnection
 public void addConnection(NetworkConnection vnc)

Register a connection to the network

Parameters:
vnc - com.gerken.vehicles.NetworkConnection
 o addHiddenNode
 public void addHiddenNode(HiddenNode node)

Register a hidden node to the network.

Parameters:
node - com.gerken.vehicles.HiddenNode
 o addReceptor
 public void addReceptor(Receptor r)

Register a receptor to the network

Parameters:
n - com.gerken.vehicles.NetworkNode
 o blue
 public static VehicleNetwork blue()

Build and return a vehicle network that veers its vehicle away from white light.

Returns:
com.gerken.vehicles.VehicleNetwork
 o chaser
 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".

Parameters:
c - java.awt.Color
Returns:
com.gerken.vehicles.VehicleNetwork
 o cruiser
 public static VehicleNetwork cruiser()

Build and return a vehicle network that travels straight ahead.

Returns:
com.gerken.vehicles.VehicleNetwork
 o getDescription
 public String getDescription()

Return the network's descriptive name

Returns:
java.lang.String
 o green
 public static VehicleNetwork green()

Build and return a vehicle network that veers its vehicle toward a white light.

Returns:
com.gerken.vehicles.VehicleNetwork
 o lemming
 public static VehicleNetwork lemming()

Build and return a vehicle network that follows others of its kind.

Returns:
com.gerken.vehicles.VehicleNetwork
 o nodeNamed
 public NetworkNode nodeNamed(String name)

Return the registered node named name.

Parameters:
name - java.lang.String
Returns:
com.gerken.vehicles.VehicleNetworkNode
 o normalizeAngle
 public double normalizeAngle(double angle)

Return the equivalent angle (in radians, between + and - pi)

Parameters:
angle - double
Returns:
double
 o orbiter
 public static VehicleNetwork orbiter(Color c)

Build and return a vehicle network that orbits any c-colored light.

Parameters:
c - java.awt.Color
Returns:
com.gerken.vehicles.VehicleNetwork
 o red
 public static VehicleNetwork red()

Build and return a vehicle network that veers its vehicle first toward and then away from a white light.

Returns:
com.gerken.vehicles.VehicleNetwork
 o setDescription
 public void setDescription(String desc)

Set the network's desriptive name.

Parameters:
desc - java.lang.String
 o setLeftMotorNode
 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.

Parameters:
n - gerken.vehicles.NetworkNode
 o setRightMotorNode
 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.

Parameters:
n - gerken.vehicles.NetworkNode
 o yellow
 public static VehicleNetwork yellow()

Build and return a vehicle network that veers its vehicle toward a white light.

Returns:
com.gerken.vehicles.VehicleNetwork

All Packages  Class Hierarchy  This Package  Previous  Next  Index