Examples of LogicalProcess


Examples of org.mitre.sim.exec.LogicalProcess

    for (Iterator i = map.keySet().iterator(); i.hasNext(); ) {
      Trigger t = (Trigger)i.next();
      if (t.condition()) {
        ArrayList lps = (ArrayList)map.get(t);
        for (Iterator lpi = lps.iterator(); lpi.hasNext(); ) {
          LogicalProcess lp = (LogicalProcess)lpi.next();
          lp.setSelectedTrigger(t);
          lp.setTriggerOccurred(true);
        }
        t.action();
        if (!lps.isEmpty()) lpsToActivate.addAll(lps);
      }
      else {
View Full Code Here

Examples of org.mitre.sim.exec.LogicalProcess

  public Collection evaluate() {
    if (waitingForTriggerLPs.isEmpty()) return null;
    HashSet lpsToBeActivated = new HashSet();
    HashSet stillWaiting = new HashSet();
    LogicalProcess nextLP;
    for (Iterator i = waitingForTriggerLPs.iterator(); i.hasNext(); ) {
      nextLP = (LogicalProcess)i.next();
      if (oneTriggerIsTrue(nextLP)) {
        lpsToBeActivated.add(nextLP);
      }
View Full Code Here

Examples of org.mitre.sim.exec.LogicalProcess

  public Population createPopulation(Class c) {
    CachedPopulation cp = (CachedPopulation)popMap.get(c);
    if (cp == null) {
      IdentityHashMap contents = new IdentityHashMap();
      for (Iterator i = lpDB.keySet().iterator(); i.hasNext(); ) {
        LogicalProcess lp = (LogicalProcess)i.next();
        if (c.isInstance(lp)) contents.put(lp, null);
      }
      cp = new CachedPopulation(contents);
      popMap.put(c, cp);
    }
View Full Code Here

Examples of org.mitre.sim.exec.LogicalProcess

  }

  public final void startSimulation() {
    loopCount = 0;
    Event nextEvent = null;
    LogicalProcess nextLP = null;
    double previousSimTime;
    long previousRealTime;
    flowControl.registerExecutiveMethod("org.mitre.sim.exec.flex.FlexExecutive.startSimulation ()V");
    while (true)  {
//      msg("StartSimulation top of loop, timeNow = " + timeNow);
//      msg("Q: " + eventManager);
      previousRealTime = System.currentTimeMillis();

      //Elaborate Dormant LPs
      while (dormantLPs.size() > 0) {
        nextLP = (LogicalProcess) dormantLPs.removeLast();
        //msg("Elaborate " + nextLP.toString());
        flowControl.elaborate(nextLP);
        nextLP.setState(LogicalProcessState.READY);
        eventManager.enqueueEvent(nextLP);
        populationManager.addLP(nextLP);
      }
     
      //Evaluate triggers
      Collection lpsToBeActivated = triggerManager.evaluate();
      if (lpsToBeActivated != null) {
        for (Iterator i = lpsToBeActivated.iterator(); i.hasNext(); ) {
          nextLP = (LogicalProcess)i.next();
          eventManager.removeEvent(nextLP);
          nextLP.setNextTime(timeNow);
          nextLP.setState(LogicalProcessState.READY);
          eventManager.enqueueEvent(nextLP);
        }
      }

      //Evaluate triggers
View Full Code Here

Examples of org.mitre.sim.exec.LogicalProcess

  private void stopLPs() {
    Event nextEvent = null;
    while ( (nextEvent = eventManager.dequeueNextEvent()) != null) {
      //msg("StopLPs " + nextEvent.toString());
      LogicalProcess lp = nextEvent.getLP();
      if (lp != null) {
        invokeEntityComplete(lp);
        flowControl.terminateLP(lp);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.