03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

public class PoissonClock extends TimedSource {<br />

}<br />

public Parameter meanTime;<br />

public Parameter values;<br />

public PoissonClock(CompositeEntity container, String name)<br />

throws NameDuplicationException, IllegalActionException {<br />

super(container, name);<br />

meanTime = new Parameter(this, "meanTime");<br />

meanTime.setExpression("1.0");<br />

meanTime.setTypeEquals(BaseType.DOUBLE);<br />

...<br />

}<br />

/** If the argument is the meanTime parameter, check that it is<br />

* positive.<br />

* @exception IllegalActionException If the meanTime value is<br />

* not positive.<br />

*/<br />

public void attributeChanged(Attribute attribute)<br />

throws IllegalActionException {<br />

if (attribute == meanTime) {<br />

double mean = ((DoubleToken)meanTime.getToken()).doubleValue();<br />

if (mean

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!