swarm-support
[Top][All Lists]
Advanced

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

Scheduling displays


From: Katherine Roberts
Subject: Scheduling displays
Date: Tue, 24 Apr 2001 15:44:35 +0100 (BST)

Hello again...

I had the scheduling set up correctly - it seems the problem occurs when
the "update" method is called. It doesn't seem to like the
"agentList.display()" bit. If I comment this out (and put lots of
prints to follow the progress) the simulation works fine, though obviously
without displaying the agents on the raster. It was working for the
single class of agent, so I just put a "drawSelfOn" call in the
agents's interface, implemented in both agent classes, and set
agentDisplay in the Observer Swarm as follows:

try{
        agentDisplay=new Object2dDisplayImpl(getZone(), worldRaster,
fishModelSwarm.getWorld(), new Selector(Agent.class, "drawSelfOn",
false))
}catch (Exception e){
        System.err.println("Exception drawSelfOn: "+e.getMessage());
}

agentDisplay.setObjectCollection(fishModelsSwarm.getAgentList());

public Object _update_(){
        if (worldRaster!=null){
                worldRaster.drawSelf();
                agentDisplay.display();
        }
}

I don't get any exceptions, it just hangs once it reaches the update
method. Am I missing something?

Thanks once more.
Katherine





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