question

Sebastien avatar image
0 Likes"
Sebastien asked Sebastien commented

Exception handling

Hi !
I am looking for a way to handle exception with code so as to stop the simulation and report the error, wether it is for the experimenter or a separate program launching FlexSim via cmd. This is capital in order to trust the results.

I saw this post from 2019, refering to an older post.

https://answers.flexsim.com/questions/74579/how-to-simply-identify-a-line-throwing-an-exceptio.html

Has there been any development on that ? Is there another way to catch those events within the simulation environment or at least to count the printed lines of a specific console ?

FlexSim 20.2.3
exceptionevent
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Andrew O avatar image Andrew O commented ·

Hi @Sebastien, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Sebastien commented

You can interrogate the experiment database using the code structure from this answer and and replace the sql statement with:

"SELECT d.name AS Scenario, c.replication AS Replication, LENGTH(a.system)>0 AS hasSystemOutput FROM console_output a INNER JOIN  tasks c, scenarios d ON c.id=a.task_id AND d.id=c.scenario_id ORDER BY Scenario ASC, Replication ASC"

Alternatively you can use regular expressions to find the number of lines in the console text of each record.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sebastien avatar image Sebastien commented ·
Thank you @Jason Lightfoot !
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.