Jump to content
Sign in to follow this  
ademes

Conditions in an Event

Recommended Posts

Hello,

Am I right when I say that the "Action if not met" refers only to the conditions of the Event and NOT to the evaluation for the triggering of the Event?

Example : Variable A = 9

Train enters a track - vehicule : any - track : track1
Conditions : none
Action when met : set variable A = 1
Action when not met : set variable A = 0

             In the event above, the variable A will never be 0 because the Event will only be triggered when the train effectively enters the track track1.  Is this correct?

Train enters a track - vehicule : any - track : $_Trigger2._Name
Conditions : none
Action when met : set variable A = 1
Action when not met : set variable A = +1

           What will be the value for the variable A?

Train enters a track - vehicule : any - track : $_Trigger2._Name
Conditions : Loco is residing on track track1
Action when met : set variable A = 1
Action when not met : set variable A = +1

           What will be the value for the variable A?

and finally

Train enters a track - vehicule : any - track : Empty
Conditions : none
Action when met : set variable A = 1
Action when not met : set variable A = +1

           What will be the value for the variable A?

 

Thank you in advance

André

Share this post


Link to post
Share on other sites

Hello André,

"Action when not met" will be only evaluated if you have explicitly specified at least one condition. With "Conditions: none" the "Action(s) when not met" will be never executed.

Following this rule, your questions 1, 2 and 4 will all result in A = 1.

Within question 3, the condition has to be understood as "Any arbitrary vehicle is residing on track track1".
When the train enters any track (needs not to be track1), the condition is true, if any vehicle (needs not to be part of the considered train) resides on track1.

Then, A = 1.
If the condition is not true, A = 10 (because it was previously 9).

The fact, that the train enters a track, will not be understood as a condition! This is an event!

Many greetings
BahnLand
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×