swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SwarmObject vs SwarmObjectImpl vs Object


From: Rob Leclerc
Subject: SwarmObject vs SwarmObjectImpl vs Object
Date: Thu, 25 Jan 2001 19:54:35 -0700

    I have been looking through the Java tutorial and I am not sure I understand the fulle use of SwarmObject and SwarmObjectImpl.  Firt of all, and as I understand it, SwarmObject is meant to represent some collection of individuals that make up a swarm.  Thus, it *appears* although there is a lot of methods, to contain most of the same functionality that SwarmObjectImpl would have but more on top of that. 
 
    Now in the HeatBugs example <HeatBug.java>  and the tutorial example <Agent2d.java> there are two different versions of how an agent is represented.  In the HB example there is no extension of SwarmObject OR SwarmObjectImpl and simply exends by default type Object.  On the otherhand Agent2d in the tutorial extends SwarmImpl, which is then used by a subclass to use the activateIn() method.  That is to say, it is left up to the "individual" to schedule his/her own events as opposed to the Observer.
 
Three questions:
 
1> Am I right in these regards?
 
2> Is there a prefered method for doing this?  I personally like the notion of an Object executing on behalf of itself.  As well and SwarmObject in a sense could also be considered
    a swarm in and of itself.
 
3> Why use the SwarmObjectImpl at all then?  As one could always schedule with the Observer an object that only extends java.lang.Object, and if one wanted more specific
    functionality one would simply use SwarmImpl.  Either way, I am not sure I even see the need for SwarmObjectImpl?
 
Rob Leclerc
University of Calgary
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]