swarm-support
[Top][All Lists]
Advanced

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

Re: Memory exhaustion


From: Marcus G. Daniels
Subject: Re: Memory exhaustion
Date: 20 Dec 2001 10:40:06 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

FW> Here are the files in a .zip file

Here is how the code could be changed to use FAction instead of
ActionTo.  Another change to make is to use java.util.{List,LinkedList}
instead of swarm.collections.{List,ListImpl}.  That will have the
advantage of using not using Objective C objects to track agents, and
thus requiring no proxy objects.  It will have a smaller footprint and
be faster.

diff -r -c orig/ModelSwarm.java modified/ModelSwarm.java
*** orig/ModelSwarm.java        Thu Dec 20 14:34:44 2001
--- modified/ModelSwarm.java    Thu Dec 20 10:25:47 2001
***************
*** 18,23 ****
--- 18,28 ----
  import swarm.space.Discrete2dImpl;
  import swarm.collections.ListImpl;
  import swarm.random.UniformIntegerDistImpl;
+ 
+ import swarm.defobj.FArgumentsImpl;
+ import swarm.defobj.FCallImpl;
+ import swarm.defobj.FArguments;
+ import swarm.defobj.FCall;
  
  
  
***************
*** 212,219 ****
        } */
  
         try{
!         modelActions.createActionForEach$message
!            (targetList, new Selector(Class.forName("TargetBug"), 
"uniformMotion", false));
         } catch(Exception e) {
              System.err.println("Exception sending message uniformMotion to 
TargetBug: " +
                  e.getMessage());
--- 217,229 ----
        } */
  
         try{
!         Selector sel =
!            new Selector(Class.forName("TargetBug"), "uniformMotion", false);
! 
!         FArguments fa = new FArgumentsImpl (getZone (), sel);
!         FCall fc = new FCallImpl (getZone (), targetList.getFirst (), sel, 
fa);
!                                   
!         modelActions.createFActionForEachHeterogeneous$call (targetList, fc);
         } catch(Exception e) {
              System.err.println("Exception sending message uniformMotion to 
TargetBug: " +
                  e.getMessage());
***************
*** 230,237 ****
         } */
  
         try{
!            modelActions.createActionTo$message
!            (this, new Selector(this.getClass(), "reapBugs", false));
         } catch (Exception e)
         {
          System.err.println("Exception reapBugs: " +
--- 240,252 ----
         } */
  
         try{
!         Selector sel =
!            new Selector(getClass (), "reapBugs", false);
! 
!         FArguments fa = new FArgumentsImpl (getZone (), sel);
!         FCall fc = new FCallImpl (getZone (), this, sel, fa);
!                                   
!         modelActions.createFAction (fc);
         } catch (Exception e)
         {
          System.err.println("Exception reapBugs: " +

                  ==================================
   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]