SpontaneousSources

SpontaneousSources is available as:

This model opens two interactive shells into which you can type and reports the time (since the start of execution) when you type something in either shell. Normally, the InteractiveShell actor blocks until you type something, so each firing would block execution in other parts of the model. Here, each InteractiveShell is placed within a ThreadedComposite with the delay parameter set to UNDEFINED and synchronizeToRealTime set to true. Thus, the InteractiveShell actors execute in their own threads, and when they produce outputs, the outputs are assigned time stamps equal to real time.

For details, see E.A. Lee, "ThreadedComposite: A Mechanism for Building Concurrent and Parallel Ptolemy II Models," EECS Department, University of California, Berkeley, Technical Report No. UCB/EECS-2008-151, December 7, 2008.