/** * Set the next activation. */ public void setNextActivation(Activation next) { // System.out.println("Set next: "+next); if(activations.contains(next)) { this.next = next; } else { throw new RuntimeException("Activation not in agenda: "+next+", "+this); } notifyListeners(); } }
/** * Set the next activation. */ public void setNextActivation(Activation next) { // System.out.println("Set next: "+next); if(activations.contains(next)) { this.next = next; } else { throw new RuntimeException("Activation not in agenda: "+next+", "+this); } notifyListeners(); } }
/** * Remove an activation * @param act The activation. */ public void removeActivation(Activation act) { // total -= System.nanoTime(); // System.out.println("Remove: "+act); this.activations.remove(act); this.counts.remove(act); if(next==act) next = null; // state++; notifyListeners(); // total += System.nanoTime(); // long currenttime = System.currentTimeMillis(); // if(currenttime>lasttime+1000) // { // if(lasttime!=0) // System.out.println("Total agenda time: "+((int)(total/1000000.0))+" ms, "+((int)((total-last)/1000.0)/(currenttime-lasttime))/10.0+"% in last step."); // lasttime = currenttime; // last = total; // } }
/** * Remove an activation * @param act The activation. */ public void removeActivation(Activation act) { // total -= System.nanoTime(); // System.out.println("Remove: "+act); this.activations.remove(act); this.counts.remove(act); if(next==act) next = null; // state++; notifyListeners(); // total += System.nanoTime(); // long currenttime = System.currentTimeMillis(); // if(currenttime>lasttime+1000) // { // if(lasttime!=0) // System.out.println("Total agenda time: "+((int)(total/1000000.0))+" ms, "+((int)((total-last)/1000.0)/(currenttime-lasttime))/10.0+"% in last step."); // lasttime = currenttime; // last = total; // } }
/** * Add a new activation. * @param act The activation. */ public void addActivation(Activation act) { // total -= System.nanoTime(); // System.out.println("Add: "+act); this.counts.put(act, Long.valueOf(count++)); this.activations.add(act); state++; notifyListeners(); // total += System.nanoTime(); // long currenttime = System.currentTimeMillis(); // if(currenttime>lasttime+1000) // { // if(lasttime!=0) // System.out.println("Total agenda time: "+((int)(total/1000000.0))+" ms, "+((int)((total-last)/1000.0)/(currenttime-lasttime))/10.0+"% in last step."); // last = total; // lasttime = currenttime; // } }
/** * Add a new activation. * @param act The activation. */ public void addActivation(Activation act) { // total -= System.nanoTime(); // System.out.println("Add: "+act); this.counts.put(act, Long.valueOf(count++)); this.activations.add(act); state++; notifyListeners(); // total += System.nanoTime(); // long currenttime = System.currentTimeMillis(); // if(currenttime>lasttime+1000) // { // if(lasttime!=0) // System.out.println("Total agenda time: "+((int)(total/1000000.0))+" ms, "+((int)((total-last)/1000.0)/(currenttime-lasttime))/10.0+"% in last step."); // last = total; // lasttime = currenttime; // } }