In comp.soft-sys.ptolemy, [EMAIL PROTECTED] writes: -------- I'm new to Ptolemy too. I am trying to do something similar to Srinivas' work. I am able to run my model (eventtry.xml) with ptexecute and also control the execution with the control panel from the commandline. In my model im using the DE domain, and I want to simulate the execution of events which will be fed from an application which I have developed. How do I interface the output of my application (which is a stream of events occuring at discrete times) to Ptolemy? One way I can think of is write the events and its time to a file and then customize the lineReader actor in Ptolemy. But this cannot be done as soon as the event is generated. Is there a better way i can do this possibly without having to switch to GUI provided by Ptolemy? Could someone elaborate on the requestChange() method and explain how it can be used in this scenario? Thanks in advance! -Kashmira. -------- I'm not totally clear on what you are trying to do, but it sounds to me like you want to generate events in a separate application, feed them to Ptolemy and have Ptolemy execute the model.
In principle, perhaps you could do something like what the DE SingleEvent actor does except your actor would read events from a file or from standard in and generate events as needed? I'm not sure if this would work or not. Someone else probably has a better idea. It might be necessary to extend the DEDirector so that it can read in events, but this seems like overkill. ptolemy.kernel.util.NamedObj.requestChange() executes a ChangeRequest that modifies the model while the model is running. The abstract base class is ptolemy.kernel.util.ChangeRequest, whose class comment is: Abstract base class for change requests. A change request is any modification to a model that might be performed during execution of the model, but where there might only be certain phases of execution during which it is safe to make the modification. Such changes are also called <i>mutations</i>. <p> A typical use of this class is to define an anonymous inner class that implements the _execute() method to bring about the desired change. The instance of that anonymous inner class is then queued with an instance of NamedObj using its requestChange() method. The execute() method must be called only once; attempting to call it multiple times will trigger an exception. <p> Concrete derived classes can be defined to implement mutations of a certain kind or in a certain way. Instances of these classes should be queued with a NamedObj, just like an anonymous inner class extending this class. MoMLChangeRequest is such a concrete derived class, where the mutation is specified as MoML code. _Christopher ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: [EMAIL PROTECTED]