I have a simple Agent in a simple context (geography package) which operates using latitude and longitude to represent space. The agent is supposed to die on the 10th iteration of the model. It is then removed from the context. On the 10th iteration of the simulation, the agent stops doing the other methods (such as moving around), so I assume it has successfully been removed from the context/died, but it does not get removed from the simulation display (just sits there).
Why does it remain in the display and how can I remove it from the display as it dies?
UPDATE: there was a bug in the repast display code. The fix files are available by contacting Eric Tatara at repast-interest@lists.sourceforge.net, although all bugs will be removed in the next release version.
public class Agent {
public Geography<Object> geography;
public Context<Object> context;
public int id;
public Agent (Context<Object>context, Geography<Object>geography) {
this.geography= geography;
this.context=context;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@ScheduledMethod(start = 1, pick = 1, interval = 1)
public void otherMethods() {
}
@ScheduledMethod(start = 10, pick = 1, interval = 1)
public void die() {
Context context = ContextUtils.getContext(this);
context.remove(this);
}
}