swarm-support
[Top][All Lists]
Advanced

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

Re: memory in java


From: Marcus G. Daniels
Subject: Re: memory in java
Date: 24 Dec 1999 12:23:41 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "MD" == Marcus G Daniels <address@hidden> writes:

MD> you might
MD> survey the various Zones you use (e.g. sending Swarms getZone),
MD> and sending the Zones getPopulation (a swarm.collection.List) in
MD> order to see what objects are in what Zones.

In ftp://ftp.santafe.edu/pub/swarm/2.0.1-fixes/diffs the patch
java-xprint.diff adds SwarmEnvironment methods for running the Swarm describe: 
methods.  The Windows stuff in the directory above is also updated.

Below is an example of how to make use of these methods.  In Objective
C Swarm `xprint' is a macro that calls the describe method on the
object, and `xfprint' calls the describe methods for each member
in a collection, where a collection is the argument to xfprint. 

Note that if you are using SUN JDK with Windows, you'll need to run
your model under the debugger so that the output stream gets set up
right.  Like this:

$ JAVASWARMGDB=gdb javaswarm TestZonePrint
(gdb) run

import swarm.Globals;
import swarm.defobj.ZoneImpl;
import swarm.defobj.Zone;
import swarm.objectbase.SwarmObjectImpl;

public class TestZonePrint {
  static public void main (String args []) {
    Globals.env.initSwarm ("TestZonePrint", "0.0", "address@hidden", args);

    Zone newZone = new ZoneImpl (Globals.env.globalZone);

    new SwarmObjectImpl (newZone);
  
    Globals.env.xprint (newZone);
    Globals.env.xfprint (newZone.getPopulation ());
  }
}

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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