Avoid Exceptions after a train collision in Anylogic

Viewed 71

I need to create a model of a simple train station where I want to have the "unwanted" option to have trains collide without the model crashing with one exception. Is there any chance to avoid the model crashing maybe stopping the two trains colliding when it happens (or just a moment before)? Thanks a lot!

2 Answers

Drag and drop Rail Settings and it has a few things for conflict resolution.

On car hit car section allows you to type in any code.

enter image description here

Here are the local variables that you can use:

enter image description here

You can also watch this video from AnyLogic: https://www.youtube.com/watch?v=ERvdz0w_Zgk

You can also simply use the outHit port on the TrainMoveTo block: enter image description here

Best do the simple rail-model step-by-step tutorial (hump yard) as it shows how to use it

Related