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-21-2011
Nischith Kashyap's Avatar
Nischith Kashyap Nischith Kashyap is offline
Flexsim User
 
Join Date: Nov 2010
Location: Wollongong, Australia
Posts: 51
Downloads: 26
Uploads: 0
Thanks: 19
Thanked 0 Times in 0 Posts
Rep Power: 118
Nischith Kashyap is on a distinguished road
Default how to make "senddelayedmessage" generic ??

Hello

We have a few network nodes (500), connected to each other to form a rail network. We are trying to make a trigger in the network nodes, so that as soon as a transporter exits one link ( a connection between two network nodes), the exiting network node (NN2) send a message back to the previous network node (NN1) making that link available for other transporters.

this is the code we have developed which we have put as an on arrival trigger for NN2.
senddelayedmessage(node("/Bondi Junction",model()),0,current,0,0,0); ( Bondi Junction being NN1)
We would like to know how to make this generic, so that we wont have to edit each and every code with the NN1 name.

Thanks
  #2  
Old 02-21-2011
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Please do not use constructs with a name (so node("/Bondi Junction") etc.) this is slow and especially with large models.

You might be able to create a hash table on reset. Simply go through the model (look at the forobject... functions) and make a column with the pointers as numbers to the previous objects and store on a label on the object the row nr of this table.

to store a pointer write something like: settablenum( "HashTable", row, col, tonum( modelobject )

and on the node write a function like

senddelayedmessage( tonode( getlabelnum( current, "RowLabel" ), 0, current, 0, 0, 0); (Even faster would be to use a ranknumber instead of "RowLabel" )

there are other ways for instance write a global function and call that function from every node and pass in the current.

Or something completely different, write on a transporter a list of pointers of the nodes that the transported has passed and everytime it enters a new one send a message to the first of the list and remove that pointer.

I hope that you have some ideas now.
  #3  
Old 02-21-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Or send it to outobject(current,fromedge).

If the traveller has been idle at the node, fromedge may be zero so you'd need record it in the arrivaltrigger
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Phil BoBo (02-21-2011)


Thread Thread Starter Forum Replies Last Post
Is it possible one object comprised of the function of "combiner" and "separetor"? Vic Li Q&A 1 08-19-2008 04:41 AM
error message "Clock overflow, running stopped" Martin Kooijman Q&A 11 04-17-2008 10:29 AM
about "no select" and "show parameter window from side bar" qin tian Gripes and Goodies 3 03-21-2008 08:10 AM
Which variable stores "Properties -> General ->Flags -> Protected" information? KelvinHo Q&A 1 03-06-2008 06:18 AM
"Getting Started" and "Tutorial" models for v4.01 Cliff King Product Announcements 0 12-10-2007 07:34 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.