swarm-support
[Top][All Lists]
Advanced

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

Announcing: EcoSwarm- Tools for Ecological Models in Swarm


From: M Lang / S Railsback
Subject: Announcing: EcoSwarm- Tools for Ecological Models in Swarm
Date: Fri, 10 Aug 2001 09:14:44 -0600

Our web site http://math.humboldt.edu/~simsys/ now has a "Software" page
where you can download code & documentation for the following classes.
These classes were developed for our fish models but could be useful for
all kinds of simulators. 

Please note that these are all in Objective C. Java users have several
options, including translating our Objective C to Java, packaging our
Objective C in a Java-accessible library as Swarm is, or convincing SDG
to add some of the classes to Swarm. (The Poisson distribution is in the
latest snapshots of Swarm; the Time Manager might go in SimTools if
people request it.)

My apologies to several people to whom I indicated the Time Manager
would be available weeks ago. It took us a while to find a robust
work-around for some of the "features" of Posix system time functions,
especially their unnatural fascination with time zones and daylight
savings time; and we found that Cygwin time functions are not completely
Posix-compliant.

Comments and questions are welcome. Thanks to Steve Jackson for the code
development, with help & ideas from Marcus, Glen, and Sven.

Steve Railsback

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EcoSwarm now contains the following code, not all of which is complete. 

/* Poisson Distribution  */
This distribution models the (integer) number of times some event
occurs, given (a) the rate (over time or space) at which the event
occurs on average, and (b) an interval (over time or space). It follows
the same format and protocols of other Swarm random distributions and
has been included in Swarm snapshots since July 24, 2001. 

Code and documentation are available.

/* Time Manager */ 
Our Time Manager class has two main functions: keeping track of model
time in simulators using daily, hourly, or other time step sizes; and
providing a number of handy time-related calculations. The class uses
the operating system's "time_t" format (number of seconds since
1/1/1970) and date-time functions. The user can, for example, set the
simulation's start time, end time, and time step size, and the Time
Manager keeps track of current simulation time as the model runs. The
time-related calculations include (for example) determining whether the
current simulation time falls within a specified date window and
determining the number of days between two time values. 

Code and documentation are available.

/* Parameter Manager */ 
The Parameter Manager class creates objects that contain the parameters
for some other component of a model (e.g., for the animals in a
population model). Parameters are added to the model simply by including
them in the ParameterManager.h file. The first purpose of the Parameter
Manager is to easily allow model agents of various subclasses to have
parameter values that vary among subclasses, even if the equations using
the parameters are coded in the superclass. For example, our trout model
has a superclass "Trout" and subclasses for various species of trout
("Rainbow", "Cutthroat") that may be in the same model. Creating one
Parameter Manager object for each species allows every fish to have
species-specific parameter values even though most of the code for trout
behavior is in the Trout superclass. 

The Parameter Manager has a second important function: it verifies that
all parameters have been initialized. Parameter values are read from an
ASCII file using Swarm's "Object Loader". The Parameter Manager uses
probes to automatically identify any parameters that were left out of
the ASCII file. 

Example code and documentation are available.

/* Time Series Input Manager */ 
Many simulation models use time-series input for driving variables- for
example, ecological models typically use hourly or daily input for
weather, river flow, etc. Our Time Series Input Manager class reads an
input file of time series data, creates an array of the data needed for
the current model run, and provides the correct input to the model for
the current simulation time. The Time Series Input Manager can be used
with daily, hourly, or other (user-defined) time steps. 

This class is currently in final revisions; documentation is available.
If interested, please contact us for a prototype of the code. 

/* Survival Probability Manager */ 
Ecological IBMs typically model survival (mortality) of individuals
using stochastic functions: A random draw is used to determine whether
each individual survives each time step, but the survival probability is
a function of the individual's state and its habitat. A number of
different survival probability functions are usually defined, each
representing one potential source of mortality (starvation, predation,
extreme weather, etc.). The Survival Probability Manager is a group of
classes that (a) allow the programmer to quickly define the survival
probabilities and (b) manage the survival simulations. A primary benefit
of the Survival Probability Manager is minimizing the code needed to
add, delete, or modify the probability models for each kind of
mortality. The Survival Probability Manager is also potentially useful
for other models in which events are modeled as stochastic functions of
one or several inputs. 

The Survival Probability Manager allows the programmer to define
"survival probabilities", each a model of one mortality source. Each
survival probability can be determined by one or more functions of the
animal or its habitat. Built-in functions include boolean ("yes-no"),
constant, and logistic. Custom functions can be programmed. 

Code is provided for updating survival functions efficiently when
habitat conditions or the animal changes. The Survival Probability
Manager provides, when requested, an array of survival probabilities for
the current state of the animal and habitat. 

This class is currently in revision. If interested, please contact us
for a prototype of the code and draft documentation. 

/* Status Reporter */ 
This class is designed to easily add file output streams to a model. The
programmer provides the name of an output file and a Swarm list of
agents for which the status is to be reported. The programmer then adds
columns to the output file by specifying the agent's method that
provides the variable of interest (weight, length, etc.) and whether the
output should be the mean, maximum, count, etc. The Status Reporter
makes extensive use of Swarm's "Averager" class. 

This class is currently in design.


-- 
address@hidden
Lang, Railsback & Assoc.
250 California Ave., Arcata CA 95521
707-822-0453; Fax 822-1868

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