pigi
, if you are using a color monitor, the color of the stem indicates the type of data that the porthole consumes or produces, as summarized in table
2-5Printer
star can produce a textual representation of any type of particle. In addition, stars which input or output Matrix type particles have stems which are extra thick with colors corresponding to the four main types, float, int, complex, and fix.
Ptolemy usually makes conversions between numeric particle types automatically. The float to complex conversion does the obvious thing, putting the float value into the real part of the complex number and setting the imaginary part to zero. The complex to float conversion computes the magnitude of the complex number. Int to float is easy enough. Float to int rounds to the nearest integer.
Xscope
star, and some other stars that generate output, accept "anytype" of input. However Xscope
isn't completely polymorphic, because it converts all inputs to float internally. So for a complex input, the magnitude will be plotted. If you want to plot both the real and imaginary parts you should use the ComplexReal
conversion star first.Merge
star. Ptolemy must assign a specific type to the Merge
star's output, but in this case it will be unable to decide which type to use, so it will complain that it "can't determine DataType" for the output. The solution is to insert one or more type conversion stars, so that all the values arriving at the Merge
star have the same type. (The type conversion stars can be found in the "conversion" palette of the appropriate domain. It will be explained below how to find this.)