you can watch the attribute isrunning of the eventcontroller. So you method can look like:
waituntil not root.eventcontroller.isRunning prio 1
[code after simulation run has stopped]
Hope this will help
Thanks for the replay.
I tried the same but dint get the results.
I am attaching a model were in the method is suppose to start simulation and after simulation is complete some modification are done in Tablefile and a promt message is displayed. But the message is displayed before the simulation starts and no modifications are done.
Please suggest the changes required so that the modifications and message pops up after the simulation is completed.
Why do you want to run a method at the end of simulation and you can not use the EndSim method?
I am wondering this just for better understand what do you need.
The model i am working on has multiple simulation that has to be runned.
The whole model is controlled throught dilogbox and buttons,
The problem with endsim is that when ever i run a perticular simulation the other codes which are suppose to happen while running a differt simulation also get exicuted, which is slowing down my model.
So i am looking for other options.
I made some changes in your model. Look at the "Init" method and the breakpoint I inserted there. When the simulation reaches this breakpoint, the simulation seems to already completed the simulation time defined on "Settings" tab of EventControler.
Is this what you need?
Even if Rafaels approach looks like your solution I would like to ask whether you're aware of the Experiment Manager. Often your kind of question can (dependent of the use case) be solved by it.
Thanks again for the model.
But this still doesnt solve my problem.
My model has different simulation runs where in i capture different data, then i modify the data based on the simulation run that has been done. The problem is in part of the modification of data I do.
I run simulation1 and collect data AA and do modification on data AA using codeA.
I run simulation2 and collect data BB and do modification2 on data BB using codeB.
But now when i run simulation1 or simulation2 both data AA and BB are getting modified because endsim or init menthod has both codeA and codeB.
What i want to do is,
when simulation1 ends only codeA must be exicuted.
when simulation2 ends only codeB must be exicuted.
Plese suggest me the modifications required for doing so,