ATTENTIONThis 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 |
#1
|
||||
|
||||
Path Selection
Hello Users,
I have a small doubt pertaining to a model I am building. I have attached a screen shot. There are a network of nodes which represents tracks. There are four trains. 2 carrying coal and the other carries grains. What i want to do is to assign tracks to the trains specifically. There are 2 tracks which can accommodate coal trains and the other 2 tracks for grain train. How can I assign the track to the train specifically according to the commodity its carrying. I tried using an on-arrival trigger on the first node -the train comes in contact with it to block or allow the train to move on depending on the commodity its carrying. Please advice. |
#2
|
|||
|
|||
OnArrival match a label on the train with a label on the next node and return the edge number on which that node is located. You'll also need to check that the node is in the same direction as the original node destination specified by toedge when the train arrives. That can be done using spatial information or by creating relationships between the network nodes where each knows its 'alternative' nodes.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Nischith Kashyap (03-20-2011) |
#3
|
||||
|
||||
Just a more general question when looking at all these "trainlike" questions, have you take a look at the RAIL API? http://www.flexsim.com/community/for...read.php?t=394
|
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Nischith Kashyap (03-20-2011) |
#4
|
||||
|
||||
Adlabel!
Hello Jason.
Thanks for the info. I am pretty new to using flexsim . Can you please guide throught the process you have mentioned as a solution for my query. Thanks a lot for this! |
#5
|
|||
|
|||
On arrival the next (default navigation) netnode is found as: outobject(current,toedge). If that node has a label, say 'coal', set to true and the train is transporting coal, and the outedge is open, then you can just return the toedge number.
Otherwise you need to find the alternative netnodes for grain, or the coal netnode that is open. So the default navigation netnode (as given by toedge initially) has a relationship to 3 alternative nodes. They can be associated to each other by: 1) Putting them all in a visual tool (be careful here - some 'jumpiness' can be introduced) 2) Adding them to a Group 3) Creating Centerport connections between them all 4) Creating NamedRelation connections between them all, or a simpler One-to-many relationship between a 'primary' node and the three others (calling them 'primary' and 'secondary' for example). The named relation code can be found in the User Development section under 'Named Connections' Otherwise you could look for network nodes that are in the vicinity of the original destination, by looking at the x and y values of all the outobject(current,n) network nodes and set a threshold for the distance tp decide which ones are in the same cluster location, and therefore can be considered for routing. Last edited by Jason Lightfoot; 03-21-2011 at 08:11 AM. |
Thread | Thread Starter | Forum | Replies | Last Post |
About multi-selection od Additional Objects in Container Terminal Statistics Export Tab... | syseo | Container Terminal (CT) Library | 0 | 02-10-2011 01:10 AM |
Fly path problem | KelvinHo | Q&A | 2 | 09-02-2010 05:29 AM |
Selection function in version 5 | David Chan | Q&A | 2 | 07-15-2010 03:36 AM |
Red selection box location? | zhang xin | Q&A | 3 | 10-22-2009 07:24 AM |
Getting an imported shape into the yellow selection box | Brenton King | Tips and Tricks | 23 | 07-24-2009 08:44 PM |