ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 02-28-2008
Sung Kim Sung Kim is offline
Flexsim User
 
Join Date: Jan 2008
Location: York, PA
Posts: 85
Downloads: 70
Uploads: 0
Thanks: 70
Thanked 9 Times in 6 Posts
Rep Power: 160
Sung Kim is on a distinguished road
Default How to dynamically set virtual distance for Network Node

Hi,

I would like to dynamically set the virtual distance in "Path" tab for a Network Node depending on the flowitems's label value. For example, if one of flowitem has a label named "destination" with a value of 5, I would like to set the virtual distance for the path of my network 5 before it starts travel on the network by a transporter.
I could not find a command to set the virtual distance directly. I think I might need to set virtual distance attribute of network node in a tree, but could not find which variable represents the virtual distance. Closest one I found is "virtualexits", but I don't think it is the right one.
Could anyone can help me how to set the distance dynamically?

Thank you in advance.
  #2  
Old 02-28-2008
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
 
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default Updating a NetworkNode's Virtual Distance During Runtime

The node is called "user dist" and it is buried deep down in the connections/connectionsout attribute of a NetworkNode. Here is a code snipit that you can use to dynamically update the virtual distance of the 2nd path (edge) to a distance of 100 in the OnArrival trigger of a NetworkNode. Notice that it is necessary to re-run Diikstra's Shortest Distance algorithm by calling the optimizenetwork() command as well.

Code:
if(toedge == 2)
{
setnodenum(rank(rank(connectionsout(current), toedge),15), 100);
optimizenetwork();
}
  #3  
Old 02-29-2008
Sung Kim Sung Kim is offline
Flexsim User
 
Join Date: Jan 2008
Location: York, PA
Posts: 85
Downloads: 70
Uploads: 0
Thanks: 70
Thanked 9 Times in 6 Posts
Rep Power: 160
Sung Kim is on a distinguished road
Default Thank you

Cliff. It is exactly what I am looking for! It works perfectly on my model. Thank you.


Thread Thread Starter Forum Replies Last Post
Dynamically assigning 3D shapes to flowitems Iulian Marin Ion Q&A 9 08-05-2013 08:17 PM
Moving Network Node Information into a Table Brandon Peterson Q&A 2 02-15-2008 09:46 AM
Expertfit cannot find network key - Flexsim Network License Kris Geisberger Q&A 0 02-05-2008 05:10 PM
How to dynamically show/hide the imported 3D shape assigned to a VisualTool Cliff King Tips and Tricks 0 09-18-2007 04:09 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.