public boolean removeAgent(IMovingAgent agent){
  boolean status=agents.remove(agent);
  if (agent instanceof Hive)   hives.remove(agent);
  if (agent instanceof FoodSource)   foodSources.remove(agent);
  if (agent instanceof Obstacle)   obstacles.remove(agent);
  if (status) {
    double radius=agent.getSphereRadius();
    if (radius >= maxAgentSphereRadius) {
      maxAgentSphereRadius=computeMaxAgentSphereRadius();
    }
  }
  return status;
}

public boolean removeAgent ( IMovingAgent agent ) { boolean status = agents . remove ( agent ) ; if ( agent instanceof Hive ) hives . remove ( agent ) ; if ( agent instanceof FoodSource ) foodSources . remove ( agent ) ; if ( agent instanceof Obstacle ) obstacles . remove ( agent ) ; if ( status ) { double radius = agent . getSphereRadius ( ) ; if ( radius >= maxAgentSphereRadius ) { maxAgentSphereRadius = computeMaxAgentSphereRadius ( ) ; } } return status ; }
remove an agent from the simulation . if the agent has a sphere which represents the maximum radius of all agents spheres the ( possible ) new maximum sphere is computed . < p > the agents are also removed from the additional lists if necessary .
