# How does one model weather in Simio and have it change how vehicles operate within the model?

For context, I am using the Simio modeling software for an OR class, and for fun I am making a simulation model of the traffic outside my dorm. I have recreated the layout and distance of the streets, and I plan on taking the stats for an hour a day for two weeks on how many cars arrive at what time, how long they wait, etc. Simply put, I'm curious about playing around and seeing various traffic behaviors that arise while modeling.

However, it rains often where I am at, say for any given day there's a 10% it will rain (for 12 hours a day) with the following occurrences (given the speed limit for these roads is 20mph):

• 50% chance a car will slow down from 1~5mph (randomly) to caution the wet roads

• 50% chance will not slow down and will go the full 20mph

Ultimately, I want to model the weather and have it change how vehicles operate within the model. I am however quite newbish with Simio and am going above my own scope of what is required for this class, and every resource I try to find online about this doesn't have anything that can answer or assist with this

The first thing I investigated was some sort of trigger that would have a 10% chance to activate per day, and have that trigger alter the vehicle's desired speeds, but then I'm unsure how this would handle the case of cars that will go the 20mph regardless, or the cars that have speeds anywhere between 15~20mph (in other words, handle when vehicles are spawned whether or not they will have varying altered speeds and how this would be timed for when it will stop raining in the 12hr mark)

• I am unfamiliar with Simio, but some simulation packages have a module namely SCHEDULE that allows to have the different behaviors for any specific entity in a predetermined interval. I hope it helps. Commented Sep 25, 2023 at 7:14

This can be done in Simio, but some assumptions must be made. For example, depending on where one lives, there are average times when it is most likely to rain. In my location, it is most likely to rain starting at 6 a.m. and 8 p.m. Therefore, the model will assume those are the times it needs to check if it will start raining.

## Events

Events are useful in Simio because they tell the objects attached to them to start or stop their operations. In this model, we're looking to tell cars to either slow down or not. Therefore, we'll need to create a Raining event like so:

## Processes

Once the Raining event has been made, all that needs to be done is deciding if it will rain on that day and if cars will or will not slow down. This can be done with two decision processes: one that points to itself in a forever loop, always checking what time it is, and another one that decides if it's raining. Structurally, they both will look like this:

One may notice that all the outputs are pointing back into the input of the first deciding node. This is done to ensure the processes, which will be initialized and called upon during the start of the model, will always be checking what time it is in the day via this condition:

DateTime.Hour(TimeNow) == 6 || DateTime.Hour(TimeNow) == 20


The probability of rain on a given day can be derived from the average percentage chance in a location during a particular time historically. For explanatory purposes, we'll say there's a 2.34% it will rain on any given day. Once this chance is hit in the second deciding node, it will fire the Raining event mentioned earlier.

To have the cars decide to slow down or not, one has to have a process initialized upon the car entity's creation that waits for the "Raining" event and then calls the 50% probability of where they slow down by changing their speed state variable. This can be done with the following processes:

However, this only accounts for if it just starts raining and hasn't been the full six hours. Therefore, we will need to adjust the model to account for this. There are multiple ways to do this, but the simplest way is to check the time after the firing event if it is 12 p.m. or 2 a.m. and stop raining like so:

via the following condition:

DateTime.Hour(TimeNow) == 12 || DateTime.Hour(TimeNow) == 2


Another way to do this is by having a process condition on the source object producing the cars and calling the slowdown process per entity creation period. However, this, in practice, was complicated to create and produced unsatisfactory results. Thus, this is the simplest way to represent the weather in Simio for this roadway model.