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 |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
||||
|
||||
Generate flowitems according to time schedules on globaltable
Hi, all~
I just wonder how to generate flowitems abid by my own schedules written on globaltable. I have a globaltable "result" to store flowitem generating schedules row by row(exact time in its row 8), and another globaltable "parameters" store the number of the next row for "result" table in its row 1 column 1. Here are code of InterArriveTime trigger in the source1. treenode current = ownerobject(c); treenode parameters = reftable("parameters"); treenode result = reftable("result"); double orderrank = gettablenum(parameters,1,1); if(gettablenum(result,orderrank,8) <= time()) value = 0; else value = time()-gettablenum(result,orderrank,8); return value; With source1's onCreation trigger, I increase the number of row1 column1 in globaltable "parameters", updating it to the row storing time for next flowitem. However, Those codes seem to have their own idea of when to generate a new flowitem, they always set time ealier than I really need Regards~ Sophia |
#2
|
||||
|
||||
Sophia,
Without seeing the model it's hard to debug. I would suggest that you keep the order rank in a label on the source rather than in a global table. This way you will be less likely to have someone else writting over it. Also, you didn't say whether you were resetting the order rank value on reset and I don't see where you are incrementing that value in your code. If you can't share the model and the above doesn't help, let us know what numbers are being produced. Good Luck, Brandon
__________________
thats not normal. |
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 |
Displaying the simulation time with the various date/time formats. | Regan Blackett | Tips and Tricks | 12 | 11-12-2012 08:01 AM |
Flowitems seems to disappear at the end of simulation run | Tom David | Q&A | 2 | 07-16-2008 03:50 AM |
Combiner: add data to a new row in a globaltable | Jörg Vogel | Tips and Tricks | 0 | 07-02-2008 07:39 AM |
Problem holding, releasing, duplicate and destroy flowitems dynamically | Sebastian Dransfeld | Q&A | 1 | 05-14-2008 09:08 AM |