Exemplo n.º 1
0
  public boolean postfire() throws IllegalActionException {

    super.postfire();
    log.debug("--- postfire");

    return false;
  }
Exemplo n.º 2
0
  public void fire() throws IllegalActionException {
    super.fire();
    log.debug("\n\n\n--- fire");

    try {
      String ce = opendapCEParameter.getExpression();
      log.debug("Constraint Expression: " + ce);

      ce = createCEfromWiredPorts(ce);

      log.debug("Using CE: " + ce);

      DDS dds = dapConnection.getData(ce);
      // log.debug("fire(): dapConnection.getData(ce) returned DataDDS:");
      // dds.print(System.out);

      log.debug("Squeezing arrays.");
      squeezeArrays(dds);

      log.debug("Broadcasting DAP data arrays.");
      broadcastDapData(dds);

      // log.debug("fire(): After data broadcast:");
      // dds.print(System.out);

    } catch (Exception e) {
      log.error("fire() Failed: ", e);
    }
  }
 /**
  * Send the token in the <i>value</i> parameter to the output.
  *
  * @exception IllegalActionException If it is thrown by the send() method sending out the token.
  */
 @Override
 public void fire() throws IllegalActionException {
   super.fire();
   double a = ((DoubleToken) _myPrivateParameter.getToken()).doubleValue();
   double b = ((DoubleToken) _myPrivateParameterWithADifferentName.getToken()).doubleValue();
   output.send(0, new DoubleToken(a + b));
   disconnectedPort.send(0, new DoubleToken(a + b));
 }
Exemplo n.º 4
0
 /**
  * Initialize the random number generator with the seed, if it has been given. A seed of zero is
  * interpreted to mean that no seed is specified. In such cases, a seed based on the current time
  * and this instance of a RandomSource is used to be fairly sure that two identical sequences will
  * not be returned.
  *
  * @exception IllegalActionException If the parent class throws it.
  */
 @Override
 public void initialize() throws IllegalActionException {
   super.initialize();
   if (_random == null || ((BooleanToken) resetOnEachRun.getToken()).booleanValue()) {
     _createGenerator();
   }
   _needNew = true;
 }
Exemplo n.º 5
0
 /**
  * Generate a new random number if this is the first firing of the iteration.
  *
  * @exception IllegalActionException If there is no director.
  */
 @Override
 public void fire() throws IllegalActionException {
   super.fire();
   if (_needNewGenerator) {
     _createGenerator();
   }
   if (_needNew) {
     _generateRandomNumber();
     _needNew = false;
   }
 }
Exemplo n.º 6
0
 /**
  * If the attribute is <i>seed</i> or <i>useThisSeed</i> then create the base random number
  * generator.
  *
  * @param attribute The attribute that changed.
  * @exception IllegalActionException If the change is not acceptable to this container (not thrown
  *     in this base class).
  */
 @Override
 public void attributeChanged(Attribute attribute) throws IllegalActionException {
   if (attribute == seed || attribute == privateSeed) {
     long seedValue;
     Token privateSeedToken = privateSeed.getToken();
     if (privateSeedToken != null) {
       seedValue = ((LongToken) privateSeedToken).longValue();
     } else {
       seedValue = ((LongToken) seed.getToken()).longValue();
     }
     if (seedValue != _generatorSeed) {
       _needNewGenerator = true;
     }
   } else {
     super.attributeChanged(attribute);
   }
 }
Exemplo n.º 7
0
  public boolean prefire() throws IllegalActionException {
    super.prefire();

    log.debug("--- prefire");

    try {

      if (dapConnection == null) {
        log.debug("OPeNDAP URL: " + opendapURL);
        dapConnection = new DConnect2(opendapURL);
      }

    } catch (Exception e) {
      log.error("prefire Failed: ", e);
    }

    return true;
  }
Exemplo n.º 8
0
 /**
  * Initialize the actor. Initializes its counter.
  *
  * @exception IllegalActionException If thrown by the super class.
  */
 public void initialize() throws IllegalActionException {
   super.initialize();
   _counter = 0;
 }
Exemplo n.º 9
0
  public void initialize() throws IllegalActionException {

    super.initialize();
    log.debug("--- intitialize");
  }