swarm-support
[Top][All Lists]
Advanced

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

Corrupted List


From: donalson
Subject: Corrupted List
Date: Fri, 17 Sep 1999 02:42:15 -0700

Does any one recognize this problem?

1.)  I create a list of "cell" objects.  One corresponding to each
discrete 2-D lattice site.

2.)  Each "cell" has a list for agents currently residing within.

3.)  I create a set of agents.  Each is created with a random X,Y
designation.

4.)  I translate that X,Y into discrete 2-D cooridnates and insert the
agent into the corrosponding "cell" list.

When I go back and try to print out each "cell" list, I find the
non-empty ones corrupted.  (actually, the first non-empty goes into an
endless loop, I don't know what happens past that.)

For example: the first cell in the list is not empty.  I print out the
list count and it says 3.  Now I start to print out the id's of the
agents in the cell list.  The first three are correct.  They match with
printouts from the agent creation loop which prints the new agent and
the cell to which it is assigned.  So far so good...

The problem is that the while( anAgent=[index next] ) should stop here,
it doesn't.  It continues to print out the id's of all agents created
after the last agent that should be in the list.  In other words, if 40
agents were created, and three were assigned to the cell in question,
say agent #3, agent #8 and agent #25; after agent #25's id is printed,
it continues to print the id's for agent #26, agent #27...agent #40.

Once it hits 40, it goes into an endless loop of 3 repeating id's
consisting of the id of agent #40 and 2 id's of which I haven't a clue.

Help!?

Cheers,

   D3

--
*********************************************************************
* Doug Donalson                 Office: (805) 893-2962
* Ecology, Evolution,           Home:   (805) 961-4447
* and Marine Biology            email address@hidden
* UC Santa Barbara
* Santa Barbara Ca. 93106
*********************************************************************
*
*   The most exciting phrase to hear in science, the one that
*   heralds new discoveries, is not "EUREKA" (I have found it) but
*   "That's funny ...?"
*
*       Isaac Asimov
*
*********************************************************************



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