if (isLeader()) { if (communityReady == false && liveAgents() == expectedAgents()) { communityReady = true; event("Community " + model.getCommunityName() + " Ready"); RestartDestinationLocator.clearRestarts(); }
if (isLeader(thisAgent)) { checkCommunityReady();
    public void enter(String name) {      if (isLeader()) {        if (communityReady == false && liveAgents() == expectedAgents()) {          communityReady = true;          event("Community " + model.getCommunityName() + " Ready");          RestartDestinationLocator.clearRestarts();        }      }      //logger.info("enter: state=ACTIVE agent=" + name);      if (isLocal(name)) {        setExpiration(name, NEVER);  // Set expiration to never, let                                     // heartbeatListener maintain state status      }    }