03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Actor Libraries<br />

SequenceScope (extends SequencePlotter): Plot sequences that are potentially infinitely long in an<br />

oscilloscope style.<br />

4.3.3 Array<br />

The array library supports manipulations of arrays, which are ordered collections of tokens of arbitrary<br />

type.<br />

ArrayAppend (extends Transformer): Append arrays on the input channels to produce a single output<br />

array.<br />

ArrayAverage (extends Transformer): Output the average of the input array.<br />

ArrayElement (extends Transformer): Extract an element from an array and produce it on the output.<br />

ArrayExtract (extends Transformer): Extract a subarray from an array and produce it on the output.<br />

ArrayLength (extends Transformer): Output the length of the input array.<br />

ArrayLevelCrossing (extends TypedAtomicActor): Find and output the index of the first item in an<br />

input array to cross a specified threshold.<br />

ArrayMaximum (extends Transformer): Extract the maximum element from an array.<br />

ArrayMinimum (extends Transformer): Extract the minimum element from an array.<br />

ArrayPeakSearch (extends TypedAtomicActor): Output the indices and values of peaks in an input<br />

array.<br />

ArraySort (extends Transformer): Sort the elements of an input array.<br />

ArrayToElements (extends Transformer): Send out each element of an input array to the corresponding<br />

channel of the output port.<br />

ArrayToSequence (extends SDFTransformer): Extract all elements from an input array and produce<br />

them sequentially on the output port.<br />

ElementsToArray (extends Transformer): Read exactly one token from each channel of the input port,<br />

assemble the tokens into an array and send it to the output port.<br />

SequenceToArray (extends SDFTransformer): Collect a sequence of inputs into an array and produce<br />

the array on the output port.<br />

4.3.4 Conversions<br />

Ptolemy <strong>II</strong> has a sophisticated type system that allows actors to be polymorphic (to operate on<br />

multiple data types). Typically, actors express type constraints between their ports and their parameters.<br />

When actors are connected, these type constraints are resolved to determine the type of each port.<br />

Conversions between types are automatic if they result in no loss of data. However, sometimes, a<br />

model builder may wish to force a particular conversion. The actors in the conversions library support<br />

this.<br />

BooleanToAnything (extends Converter): Convert a Boolean input token to any data type.<br />

Heterogeneous Concurrent Modeling and Design 135

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

Saved successfully!

Ooh no, something went wrong!