Hi Vincent,

You can implement a ptolemy.actor.ExecutionListener, and do a ptolemy.actor.Manager.addExecutionListener(...) before launching the model through the manager.

Then you are notified of the end of a model execution, but e.g. also when there's an exception during the execution.



Planat, Vincent wrote:
I’m currently using Ptolemy in a “batch” mode in the sense that I loop several time a Ptolemy model to converge to a solution.
To do that I have a class (convergeEngine) which does a
*new* MoMLSimpleApplication(moMlFileVal);
The moMlFileVal contains a Customized actor fired() several hundred time. At each fire() I produce outputs to a file (myOutFile.txt) When the moMlFileVal has finished its execution I retrieve the content of the myOutFile.txt, modify the moMlFileVal and restart a *new* MoMLSimpleApplication(moMlFileVal);
My problem is the following:
Has I don’t know how to be call-back when the model (moMlFileVal) finishes its execution, I need to open(in append mode) and close myOutFile.txt several thousand times which affect seriously the performance… If I could be called-back when the model finishes, I could open the myOutFile.txt when it starts (initialize()) and close it only at the end ..
How can I do that ?
Thanks for your support

Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to