--- experimental/agents/BasicAgent.java 2001/05/04 02:04:35 1.2 +++ experimental/agents/BasicAgent.java 2001/05/06 19:01:48 1.3 @@ -13,7 +13,7 @@ import java.util.Random; * A basic implementation of the Agent abstract class * * @author $Author: ajm $ - * @version $Id: BasicAgent.java,v 1.2 2001/05/04 02:04:35 ajm Exp $ + * @version $Id: BasicAgent.java,v 1.3 2001/05/06 19:01:48 ajm Exp $ */ class BasicAgent extends Agent { @@ -22,7 +22,7 @@ class BasicAgent extends Agent { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.2 $"; + public static final String REVISION = "$Revision: 1.3 $"; //---STATIC METHODS--- @@ -83,7 +83,6 @@ class BasicAgent extends Agent { PeerHandler dstPeer = (PeerHandler) peers.get(0); _station.sendAgent(this, dstPeer); } - say("No peers to move to...staying here."); } } @@ -92,6 +91,7 @@ class BasicAgent extends Agent { public void onArrival(Station station) { _transmissionCount++; _station = station; + _running = true; say("Just arrived at - " + _station.getName()); } @@ -115,13 +115,23 @@ class BasicAgent extends Agent { * Used to shutdown this thread */ public void shutdown() { + say("shutting down"); _station = null; _running = false; } //*** OTHER PUBLIC METHODS *** - + //---PRIVATE/PROTECTED METHODS--- + + /** + * Overridden for debugging purposes + * to see when an instance of this class + * is destroyed + */ + protected void finalize() throws Throwable { + say("dead - just been gc'd"); + } //---ACCESSOR/MUTATOR METHODS---