Ejemplo n.º 1
0
 /**
  * Open the file at the URL, and set the width of the output.
  *
  * @exception IllegalActionException Not thrown in this base class
  */
 @Override
 public void initialize() throws IllegalActionException {
   super.initialize();
   System.out.println(
       "actor.lib.Reader is obsolete, " + "use actor.lib.io.ExpressionReader instead");
   _dataSize = output.getWidth();
   _data = new double[_dataSize];
   attributeChanged(sourceURL);
 }
Ejemplo n.º 2
0
  /**
   * Initialize the actor. Schedule a refiring of this actor at the stop time given by the
   * <i>stopTime</i> parameter.
   *
   * @exception IllegalActionException If there is no director.
   */
  public void initialize() throws IllegalActionException {
    super.initialize();

    Director director = getDirector();

    if (director == null) {
      throw new IllegalActionException(this, "No director!");
    }

    double stopTimeValue = ((DoubleToken) stopTime.getToken()).doubleValue();
    _stopTime = new Time(getDirector(), stopTimeValue);

    Time currentTime = director.getModelTime();

    if (!_stopTime.isInfinite() && (_stopTime.compareTo(currentTime) > 0)) {
      director.fireAt(this, _stopTime);
      _executing = true;
    }
  }