Package org.mitre.sim

Examples of org.mitre.sim.Trigger


  public void conditionMayHaveChanged(Object notifier) {
    //NB: notifierMap entries accumulate: there is no pruning
    List triggers = (List)notifierMap.get(notifier);
    if (triggers != null) {
      for (Iterator ti = triggers.iterator(); ti.hasNext(); ) {
        Trigger trigger = (Trigger)ti.next();
//        System.out.println("Trigger reports: " + trigger);
        ArrayList lpSet = (ArrayList) instrumentedUnchanged.remove(trigger);
        if (lpSet != null) {
          //some entity is waiting on the trigger, and it hasn't already been moved to
          //instrumentedUnknown
View Full Code Here


   * @return culled Trigger map; should replace the map passed in
   */
  private IdentityHashMap cullTriggers(IdentityHashMap map, HashSet lpsToActivate) {
    IdentityHashMap stillWaiting = new IdentityHashMap();
    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 {
        stillWaiting.put(t, map.get(t));
      }
View Full Code Here

  public AnonymousEntity(String name) {
    super(name);
  }
 
  public void agenda() {
    this.waitForActionOrTrigger(new Trigger() {
      public boolean condition() {
        return i == 0;
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.mitre.sim.Trigger

Copyright © 2018 www.massapicom. 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.