Page 1 of 1

[Fixed] Random Time Function not working?

Posted: Mon Jul 19, 2021 7:12 am
by BeirutDude
In designing a scenario I noted that the Random Time Trigger doesn't seem to be working. So I set up a quick scenario that just pops up a message that says the Random Time Function triggered and ran for a month.

No triggers.

RE: Random Time Function not working?

Posted: Mon Jul 19, 2021 10:57 am
by michaelm75au
I narrowed the trigger down to 7 days, and it fired. So the trigger itself is working.


Image

RE: Random Time Function not working?

Posted: Mon Jul 19, 2021 6:28 pm
by BeirutDude
Wonder if there is something wrong with my system because in the original scenario, over three days, I had 18 separate events based on the Random Time Function/Trigger and in two test runs on the base scenario 18 separate events didn't trigger, not once. That doesn't sound right, 18 events over a total of six days?. I even deleted and redid the trigger between tests one and two. And then I ran that scenario I posted for the month in rapid time and it didn't fire on my computer.

How often does it check (or do whatever it does)? I get the idea it is random but the above defies the laws of probability! [8|]

RE: Random Time Function not working?

Posted: Mon Jul 19, 2021 7:18 pm
by BeirutDude
So I ran it again, no joy.

I reloaded the C:MO program and...

Image

RE: Random Time Function not working?

Posted: Mon Jul 19, 2021 10:35 pm
by boogabooga
What is actually random and what "feels" random to a human are two very different thing.

RE: Random Time Function not working?

Posted: Tue Jul 20, 2021 3:55 am
by michaelm75au
I'm going to suggest adding the value of the 'random' time to the trigger screen when in Edit mode so it can be visual check of when to expect the trigger to fire.

RE: Random Time Function not working?

Posted: Tue Jul 20, 2021 4:22 am
by michaelm75au
ORIGINAL: BeirutDude

Wonder if there is something wrong with my system because in the original scenario, over three days, I had 18 separate events based on the Random Time Function/Trigger and in two test runs on the base scenario 18 separate events didn't trigger, not once. That doesn't sound right, 18 events over a total of six days?. I even deleted and redid the trigger between tests one and two. And then I ran that scenario I posted for the month in rapid time and it didn't fire on my computer.

How often does it check (or do whatever it does)? I get the idea it is random but the above defies the laws of probability! [8|]

The first time the trigger is checked, it will calculate a 'random' time and use this value for any subsequent checks.

I'll check if that is the correct behavior.

Did you save and reload the scenario during these times? Thinking that when it reloaded and set the new random time, it was before the current time and didn't trigger for some reason.

RE: Random Time Function not working?

Posted: Tue Jul 20, 2021 7:14 am
by michaelm75au
I've revisited this and tried multiple cases, and it always seems to fire the trigger. The randomness in the 4 week scenario does seem to favor the higher end of the scale but that seems to be more a factor of the very large values being used - random (0, 2683800) seconds to add to the trigger 'earliest' date to get the trigger date.

RE: Random Time Function not working?

Posted: Tue Jul 20, 2021 7:57 am
by BeirutDude
Thanks for checking but I really think now that something was corrupted on my computer. I did not save during any of the runs. I did run in the Scenario Editor but that shouldn't make a difference???? Really four runs like that without it firing says something was wrong, especially since it worked almost immediately right after I reloaded the program.

Something stuck I guess?

RE: Random Time Function not working?

Posted: Tue Jul 20, 2021 10:55 am
by Rory Noonan
The problem in your test scenario is the time settings are in 2019. The scenario is set in 2021.

It's a really easy mistake to make, I do it all the time.