break;
  public void execute()  {    switch (state) {    case INITIAL:      // No point in looking for metrics providers if there ate no local      // Assets      if (localAssets.size() > 0) {        for (Iterator iterator = localAssets.getCollection().iterator();             iterator.hasNext();) {          addMetricsProviders((HasRelationships) iterator.next());        }        if (checkProviders()) {          sendControl(Verb_Ready);          setCurrentState(WAITING);        }      }      break;    case WAITING:      if (checkControlTasks(readyAllocations)) {        sendControl(Verb_Start);        setCurrentState(STARTING);      }      break;    case STARTING:           if (checkControlTasks(startAllocations)) {        startTime = System.currentTimeMillis();	startRunning();	        setCurrentState(RUNNING);        startSampleTimer();      }      break;    case SAMPLING:      // Keep tabs on the society      //checkRootTasks();         // Keep this up to date      if (checkControlTasks(sampleAllocations)) {	// OK, done with sampling. Go back to running        setCurrentState(RUNNING);	// Keep the system going        //fillTaskQueue();      }      break;    case RUNNING:      // Without this next, there's no way to stop!      // we'll never go to the "FINISHING" state            if (doneRunning()) {	finish();               // All root tasks have been sent,	break;      }      // If it's time again, do another sample      if (sampleTimer != null && sampleTimer.hasExpired()) {        setCurrentState(SAMPLING);        sendControl(Verb_Sample);        startSampleTimer();     // Restart        break;      }      // otherwise, keep the society running      //fillTaskQueue();          // Keep the task queue topped off      break;    case FINISHING:      // the society is done running. Make sure we've done all our sampling      if (checkControlTasks(finishAllocations)) {        finishEverything(); // in Ray's version, this does a System.exit()      }      break;    }  }