swarm-modeling
[Top][All Lists]
Advanced

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

RE: Compare Swarm with Repast


From: gepr
Subject: RE: Compare Swarm with Repast
Date: Sun, 11 Aug 2002 17:34:54 -0700

Christopher J. Mackie writes:
 > I've never understood what Paul has against Java--what's not to like about
 > someone else taking out your garbage? :-)

I don't intend in religious discussions, either.  But one comment must
be made w.r.t. Java/C++ vs. Obj-C.  (And I'm lumping C++ in there with
Java in order to demonstrate that my point isn't about the tools, at
all, it's about the task at hand when modeling.)

Objective-C has a very natural syntax for agent-based modeling because
it reflects more closely the concept of messages.  Rhetorically, OO is
a good modeling language because it allows the modeler to think in
terms of things that [re-]act.  Nodes and links.  Objects and
relationships.

In the same vein, a message-based syntax is more natural for modeling
networks and social or ecological systems because it *encourages* the
modeler to think in terms of thing A interacting with thing B by
depositing/reading thing C into a medium.

Java and C++ use a "function call" syntax.  This means that thing A
interacts with thing B by knowing what functions thing A has hanging
off of it and then calling those functions.  This obfuscates the
medium in which they both sit.  Objective-C, though capable of this
"function call" style, also allows the modeler to think the other way
without doing the automatic translation between the model and the
code.

There's no serious difference here.  But, for *modeling*, Objective-C
is more flexible (and, therefore, more dangerous and useful). And
since I *like* the message-based syntax, I prefer it over Java or C++,
regardless of the technical details of things like garbage collection,
good exception handling, an abundance of APIs, etc.

 > If you have to ask us which one is better, stick with RePast.  The
 > kinds of folks who will do well with Swarm are the ones comfy
 > enough with building tools in *N*X or Windows that they don't
 > bother to ask us: they just download both, install them, and try
 > them out directly.  If that's not you, RePast will get you from
 > zero to published a lot quicker.  Moreover, Java and comparable
 > "managed code" languages are clearly the direction the world is
 > headed, so the programming skills you pick up with RePast will be
 > more fungible down the road (also true for JavaSwarm but a bit less
 > so, since if you're *really* using Swarm, sooner-or-later you'll
 > need to write ObjectiveC to do the cool stuff).
 > 
 > On the other hand, if you know enough about computing to get Swarm
 > installed by trial-and-error plus a few consults to Paul's FAQ and
 > the list archive, *and* if you're already a competent C/ObjectiveC
 > programmer, *and* if you have various high-performance modeling
 > needs that a Java VM will only complicate (and you know enough
 > about Java VMs to know that's true), then Swarm may well be what
 > you're looking for.

This line of reasoning is exactly right.  (Though I would encourage
you to *try* to use both implementations and pick whichever works best
for whichever task is at hand, rather than defaulting to RePast just
because it's easier to get toy models working.)

RePast and the Objective-C implementation are both Swarm and should be
thought of that way.  Use whichever is appropriate.

Some additional guidelines are:

Use the SDG's implementation if:
 o your model will contain code in multiple languages or exploit
   ObC, C, C++, Fortran, Java, Javacript, Scheme, COM, etc., 
 o you need to exploit the efficiency of the C runtime, 
 o you need online access to tools like HDF and R,
 o you want the tools to encourage thinking in terms of
   message-passing instead of function calling.

Use RePast if:
 o you prefer 100% Java,
 o your model will remain simple,
 o you don't have the resources to spend on systems administration, or
 o you want to briefly explore Swarm but don't want to commit to it.

-- 
glen e. p. ropella              =><=                           Hail Eris!
H: 831.335.4950                              http://www.ropella.net/~gepr
M: 831.247.7901



                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using 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]