question

dougdurbin avatar image
0 Likes"
dougdurbin asked Matthew Gillespie commented

Dynamic Virtual Distance

Hi,

I've looked at some other answers regarding this but I still can't seem to figure it out. I'm building a general transportation model and want the distances between 2 nodes to change upon arrival. This prevents building a network of nodes with varying distances to the same point. The distances would be changed through a distribution (uniform, normal,etc.). from Node 1 to Node 2. To make things complicated, is there a way to set a different virtual distance between those nodes per staff upon arrival: Transporter 1 w/ patient arrives at Node 1, distance is changed to "X" to Node 2. While Transport 1 is on the path, Transporter 2 w/ patient arrives at Node 1, distance for Transporter 2 is changed to "Y" to Node 2. Would Transporter 1 still adhere to distance "X", while Transporter 2 would remain with distance "Y"? Is there a better way to do this? I thought about dynamically changing the transporter's speed along the path from Node 1 to Node 2, but it seems like I can't put in a distribution:

Activity Started Trigger:

setvarnum(getrequiredresource(patient,60,STAFF,1), "maxspeed", uniform(10,500,0));

This code doesn't seem to change anything.

FlexSim HC 5.3.10
virtual distance
5 |100000

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

1 Answer

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered Matthew Gillespie commented

Changing the virtual distance during the model run isn't supported behavior.

You should be able to change the staff's speed. Using a distribution works fine.Take a look at this sample model. I'm using the OnArrival trigger of NN2 to set the speed of the traveler to a value from a distribution.

changespeeds.fsm

Two things to keep in mind about doing this:

  1. You'll need to reset the maxspeed of anyone you change in an OnReset trigger. Otherwise the staff will have the maxspeed value of the last time the code changed it. This will introduce extra randomness in the model and it will no longer be repeatable.
  2. The distance traveled statistics won't reflect the longer distances since you're changing speeds not the distance.

changespeeds.fsm (102.9 KiB)
· 3
5 |100000

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

dougdurbin avatar image dougdurbin commented ·

Thank you! This works as intended.

0 Likes 0 ·
dougdurbin avatar image dougdurbin commented ·

What is the speed in units? The default staff speed is set to "80" but what does that mean in the real-world? Since I'm changing the speed to reflect a certain distance I'm trying to determine the length of travel based on speed.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ dougdurbin commented ·

FlexSim HC uses meters for length and minutes for time. So the speed is 80 meters per minute which is about 1.333 meters per second.

1 Like 1 ·