Programatically interrupt simulation runtime based on condition testing

Use this forum to post Vensim related questions.
Post Reply
efranco
Junior Member
Posts: 5
Joined: Tue May 11, 2021 10:55 am
Vensim version: PRO

Programatically interrupt simulation runtime based on condition testing

Post by efranco »

Hello,

I would like to know if it is possible to stop the simulation runtime based on condition testing.

I searched in Vensim's documentation and the forum but couldn't find any clue.

The model I am working on has as one of its goals the elapsed time to reach a predefined goal.

In some platform (e.g., AnyLogic), it is possible to programmatically interrupt the runtime:

getEngine().getExperiment().stop(); or by using events.

Is it possible to do something similar in Vensim?

Thank you very much, Eduardo.
Administrator
Super Administrator
Posts: 3876
Joined: Wed Mar 05, 2003 3:10 am

Re: Programatically interrupt simulation runtime based on condition testing

Post by Administrator »

I've attached a model showing how to do this. All you do is modify FINAL TIME.
Attachments
StopSimAt50.mdl
(1.81 KiB) Downloaded 27 times
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
efranco
Junior Member
Posts: 5
Joined: Tue May 11, 2021 10:55 am
Vensim version: PRO

Re: Programatically interrupt simulation runtime based on condition testing

Post by efranco »

Thank you very much! It worked perfectly.
Post Reply