log = CSMART.createLogger(this.getClass().getName());
  public void setupSubscriptions() {    log = CSMART.createLogger(this.getClass().getName());    if (log.isDebugEnabled()) {      log.debug("setupSubscriptions:" + this + ":Entering");    }    peSub = (IncrementalSubscription) subscribe(peP);    taskSub = (IncrementalSubscription) subscribe(taskP);    Asset proto = theLDMF.createPrototype(		 "org.cougaar.tools.csmart.runtime.ldm.asset.HappinessAsset", PROTO_NAME);    happiness = (HappinessAsset) theLDMF.createInstance(proto);    HappinessPG hPG  = (HappinessPG) theLDMF.createPropertyGroup(HappinessPG.class);      hPG.setHappinessAt(currentTimeMillis(), startingHappiness);    happiness.setHappinessPG(hPG);    publishAdd(happiness);    // Load in the config file.    Vector pv = getParameters() != null ? new Vector(getParameters()) : null;    if (pv == null || pv.size() < 3) {      throw new RuntimeException(				 "CustomerPlugIn expects parameters, SIMStartTime, SIMStopTime and TaskFileName.");    }    try {      startSIMTime = Long.parseLong((String)pv.elementAt(0));      stopSIMTime = Long.parseLong((String)pv.elementAt(1));    } catch (NumberFormatException nfe) {      throw new RuntimeException(				 "CustomerPlugIn unable to parse Sim start or stop: " + 				 (String)pv.elementAt(0) + ", " + (String)pv.elementAt(1));    } catch (ArrayIndexOutOfBoundsException aoe) {      throw new RuntimeException("CustomerPlugIn expects parameters: StartSIMTime, StopSIMTime, TaskFileName");    }     double timeDiff = (stopSIMTime - startSIMTime);    if (timeDiff <= 0.0) {      throw new RuntimeException(  				 "SIM Stop time must be greater than Start Time");    }    double nowTime = (double)currentTimeMillis();    if (startSIMTime < nowTime) {      startSIMTime = nowTime;      stopSIMTime = startSIMTime + timeDiff;    }    String taskFileName = (String)pv.elementAt(2);    if (taskFileName == null) {      throw new RuntimeException(				 "CustomerPlugIn expected param[0] to be taskFile name");    }    if (taskFileName.equals("none")) {      // New CSMART config UI puts this in if the customer is not to publish any tasks      // So we're done here....      if (log.isDebugEnabled()) {	log.debug("setupSubscriptions: " + this + " has no task file. Not publishing any tasks!");      }    } else {      loadTasks(taskFileName);      // Publish one of each task.      Iterator iter = tasks.values().iterator();      while(iter.hasNext()) {	SingleCustomerTask ct = (SingleCustomerTask) iter.next();	publishTask(ct);      }    }    pubDelay = 0l;  } // end of setupSubscriptions()