Nodenet Problem Set Javadocs

nodenet
Interface NodeBehavior


public interface NodeBehavior

NodeBehavior is the interface you must implement in your code. It defines a single method, act.

Version:
$Id: NodeBehavior.java,v 1.3 2004/01/14 21:43:17 gus Exp $
Author:
Todd C. Parnell, tparnell@ai.mit.edu

Method Summary
 void transmitPacket(InputChannelVector inputChannels, OutputChannelVector outputChannels)
          TransmitPacket is the method you will write for this lab.
 

Method Detail

transmitPacket

public void transmitPacket(InputChannelVector inputChannels,
                           OutputChannelVector outputChannels)
TransmitPacket is the method you will write for this lab. It has two arguments, one which is an InputChannelVector, and the other an OutputChannelVector, corresponding to the inputs and outputs available to you. Note that the channels obtained from these vectors (if any) exist, but are perhaps disabled, full, or empty. You will need to be aware of these conditions.

TransmitPacket is called repeatedly by a Node from within a while (true) {} loop. You should deal with a single task on each iteration. Failure to return promptly will result in unpredictable behavior.

Parameters:
inputChannels - A vector that may contain input channels
outputChannels - A vector that may contain output channels
See Also:
ChannelFullException, ChannelDisabledException, ChannelEmptyException

Nodenet Problem Set Javadocs