Hi, 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 Cheers