@Override public void update(SimulationThread simulationThread){
  if (simulationThread.isCanceled()) {
    frame.setStatus("Task canceled.");
    isPrepared=false;
  }
 else   if (frame.simulationPaused()) {
    frame.setStatus("Task paused.");
  }
 else {
    StringBuffer statusMsg=new StringBuffer();
    statusMsg.append("Task completed");
    List<Agent> agents=env.getAgents();
    if (agents.size() == 1) {
      Double travelDistance=env.getAgentTravelDistance(agents.get(0));
      if (travelDistance != null) {
        DecimalFormat f=new DecimalFormat("#0.0");
        statusMsg.append("; travel distance: " + f.format(travelDistance) + "km");
      }
    }
    statusMsg.append(".");
    frame.setStatus(statusMsg.toString());
  }
}

@ Override public void update ( SimulationThread simulationThread ) { if ( simulationThread . isCanceled ( ) ) { frame . setStatus ( "Task canceled." ) ; isPrepared = false ; } else if ( frame . simulationPaused ( ) ) { frame . setStatus ( "Task paused." ) ; } else { StringBuffer statusMsg = new StringBuffer ( ) ; statusMsg . append ( "Task completed" ) ; List < Agent > agents = env . getAgents ( ) ; if ( agents . size ( ) == 1 ) { Double travelDistance = env . getAgentTravelDistance ( agents . get ( 0 ) ) ; if ( travelDistance != null ) { DecimalFormat f = new DecimalFormat ( "#0.0" ) ; statusMsg . append ( "; travel distance: " + f . format ( travelDistance ) + "km" ) ; } } statusMsg . append ( "." ) ; frame . setStatus ( statusMsg . toString ( ) ) ; } }
updates the status of the frame .
