swarm-support
[Top][All Lists]
Advanced

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

Re: FAction


From: Doug Donalson
Subject: Re: FAction
Date: Thu, 7 Sep 2000 13:41:34 -0700

I have often found a simple stop watch (if "time" isn't available) useful in
measuring performance.  I just choose some measure such as time between two
population sizes of time or to execuit a certain number of steps.  (This is
predicated on having sole use of the processor or highest user priority.)
If the differences are so small that you need a finer measure than I expect
that the speedup is insiginificant.

I just used this to win an argument [grin].  One of my former committee
members argued that the details I put into my model to improve speedup by
using  nearest neighbors was so costly in terms of development time
(translate to debugging) that it would be much more time efficient to just
use an O(n^2) search of agents.  I coded up his version of the model and ran
both versions from 0-1000 individuals (this was an immigration model).  The
O(n^2) version took about 7:30 to about 0:45 for my optimized version.  nice
but probably not enough to justifiy greatly incresed development time.
However, we need the system to handle 5,000-10,000 individuals.  I then ran
the same experiment for the time from 1000-2000 individuals.  The optimized
time was 1:33; I killed the O(n^2) run at 1800 individuals and 41 min.  I
think that this sort of speedup does justify increased development time.
(Hi Bob!)


Cheers,

   D4

----- Original Message -----
From: Fred Wan <address@hidden>
To: <address@hidden>
Sent: Thursday, September 07, 2000 7:43 AM
Subject: RE: FAction


> I have replaced the action creation procedure through FAction instances by
> Action instances for jheatbugs and it works fine as well. Even to the
extent
> that I'm wondering what the (time) benefit is for using FAction (as was
> replied to my query, FAction supposedly offers the advantage of reducing
the
> number of indirections) which brings me to the following question. Are
there
> methods in Swarm to measure real-time performance to make optimizations in
> the code visible?
>
> Below is the code fragment using FAction (commented out) and Action.
>
>     /*
>     try {
>       Heatbug proto = (Heatbug) heatbugList.get (0);
>       Selector sel =
>         new Selector (proto.getClass (), "heatbugStep", false);
>       actionForEach =
>         modelActions.createFActionForEachHomogeneous$call
>         (heatbugList,
>          new FCallImpl (this, proto, sel,
>                         new FArgumentsImpl (this, sel, true)));
>     } catch (Exception e) {
>       e.printStackTrace (System.err);
>     }
>     */
>
>     try {
> Selector sel = new Selector(Class.forName("Heatbug"), "heatbugStep",
> false);
> modelActions.createActionForEach$message(heatbugList, sel);
>     } catch (Exception e) {
> System.err.println("Exception heatbugStep: " + e.getMessage());
>     }
>
>
>
>                   ==================================
>    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.
>


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