question

Jim Montgomery avatar image
0 Likes"
Jim Montgomery asked Jim Montgomery answered

How does one close a path in a new scenario

In this ED model, I would like to build a scenario in which a hallway (path) is closed, thus denying access to both patients and staff and forcing them to travel detour paths. Then I plan to compare travel time of patients and staff between scenarios.How does one use the Scenarios Table to shut down a hallway path?

Thanks, Jim

Tee.hiett@flexsim

Sumanth.raja@flexsim

Lou.keller@flexsim

FlexSim HC 5.1.0
close a pathnew pathscenario with new pathscenarios new pathscenaro
5 |100000

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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie edited

Here is a sample model where I wrote a custom code scenario variable to close a specific path. Just specify the from and to nodes in the code.

string fromNode = "NN1";
string toNode = "NN5";

string path = concat(fromNode, ">connections/connectionsout/To ", toNode);
treenode pathNode = node(path, model());
function_s(node(fromNode, model()), "setEdgeType", pathNode, XX + 1); //0-close 1-open

path = concat(toNode, ">connections/connectionsout/To ", fromNode);
pathNode = node(path, model());
function_s(node(fromNode, model()), "setEdgeType", pathNode, XX + 1); //0-close 1-open

optimizenetwork();

closepath.fsm (83.8 KiB)
· 2
5 |100000

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

Jim Montgomery avatar image Jim Montgomery commented ·

Thanks, Matthew, for the demo model and the Flexscript. I have met with problems when attempting to adapt the method as demonstrated to my model.

1. Let’s assume now that instead of closing one path segment between 2 nodes, as you demonstrated, that one must close off a corridor that contains many nodes (see Fig 1) and many locations. In the illustration below, I would like to close the path from NN217 to NN118. I attempted to assign NN217 to fromNode and NN118 to toNode, but this did not close the pathway, as I observed resources using it while running the model in animation mode. Then I attempted to close two path segments on either end of the pathway using the same method but using an additional experiment variable: NN217 to NN235 and NN210 to NN118. This also did not work, as I again observed resources traveling along the path. What am I doing wrong?

2.The second issue is that when I attempt to view the dashboard results for “Resources Distance Traveled” and “Resources Staff State Times” no results are displayed for the Scenario 2….only the Base Scenario.However, the “Patients Distance Traveled” and “Patients State Times” display fine for both scenarios.What is wrong here?

Fig 1

0 Likes 0 ·
gcfio.png (79.9 KiB)
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Jim Montgomery commented ·

1.This script only works for closing the path between two adjacent network nodes, so using 217 and 118 won't work. Sorry I didn't make that clear. Just do any two adjacent nodes along that string of nodes and it should work. Also the original code I wrote is only closing the path in one direction. I've now updated the code to close both directions. Give that a try.

2. I can't really say without seeing your model. Please ask this as a separate question (since it's not directly related to the original question) and include your model. Mark your question as private if the model is sensitive. Thanks!

0 Likes 0 ·
Jim Montgomery avatar image
0 Likes"
Jim Montgomery answered

Thank you. That seems to have solved the problem.

5 |100000

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