What makes an actor domain polymorphic?
As for making actors domain polymorphic, the general rule we follow is: • return false in prefire() if there is insufficient input data to fire • consume a token at each input if one is present in fire() • produce outputs in fire() • update the state of the actor in postfire(), not fire If more than one output token is produced on an output port or consumed on an input port in fire(), then the input port should have a tokenConsumptionRate parameter or the output port tokenProductionRate Parameter indicating how many tokens are produced. (To see sample values, in the FIR actor, right click on the input or output port and select configure). If these rules are followed, then the actor will work in at least: DE, SDF, CT, PN, SR, CI The most difficult of the rules to follow is updating the state only in postfire(). This rule only matters in CT because CT may have to backtrack time 5.5 How do I interface to C/C++ Ptolemy II is written in Java, and Java has the Java Native Interface (JNI), se