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 07-18-2008
sophia yao's Avatar
sophia yao sophia yao is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 4
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
sophia yao is on a distinguished road
Question 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  
Old 07-18-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

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


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.