public void run(double duration) {
    double endtime = _currentTime + duration;
    while ((!empty()) && (_queue.peek().waketime <= endtime)) {
      if ((_currentTime - _queue.peek().waketime) > 1e-09) {
        super.setChanged();
        super.notifyObservers();
      }
      _currentTime = _queue.peek().waketime;
      dequeue().run();
      //super.setChanged();
      //super.notifyObservers();
    }
    _currentTime = endtime;
  }