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 |
Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook. |
#1
|
|||
|
|||
Cannot use label
I use the discrete model to simulate a barge operation in a container terminal. For each barge, a maximum waiting time will be assigned, so, in my model, I set 4 labels to calculate the waiting time of each barge. This can be done by using arrival schedule of the source. However, when the source changes the arrival style to an inter-arrival time and uses distribution to represent it, the labels cannot work. How to assign labels when the arrival style is inter-arrival time?
|
#2
|
|||
|
|||
Hi,
You can do it in 2 ways. First is to create the labels on the FlowItem in FlowItemBin and then use the pick option Set Label in OnCreation or OnExit trigger on a Source. The second way is to use Create and Initialize Label you will find that pick option also under OnCreation and OnExit. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Jack Lai (11-22-2011) |
#3
|
|||
|
|||
Thanks for your useful reply.
Recently, I cansider that the service time of barge berths are not 100%, in some case, the berth will stop service due to equipment maintaince or other reasons. So, can Flexsim discrete model set the service time of the processors?? For example, berths will operate only 16 hours a day. Thanks for any advice. |
#4
|
|||
|
|||
Hi,
Take a look at Time Tables, there you can define when the berth will be available. Time Table is used when you know when the berth is down. If the down time is random you should use MTBF/MTTR. Lars-Olof |
#5
|
|||
|
|||
For example, I use the code[By time of day] to design where it is operating or not, but error occured. What is wrong in my coding??
treenodecurrent = ownerobject(c); /**By Time of Day:*/ int second = 1; int minute = 60; int hour = 3600; int day = 86400; int shift = 28800; /** \nModel Time Unit: */ int timeunits = /**/minute/**/;/** (second, minute, hour, day)\n*/ int timeinseconds = fmod(time()*timeunits, day); hour = trunc(timeinseconds / hour); shift = trunc(timeinseconds / shift) + 1; /**\n*/ /**/if(hour > 0&& hour < 1) return 0.3 + 0.2 * beta(2.19, 2.11,0,0,0); else if(hour > 1&& hour < 2) return 0.25 + 0.24 * beta(2.73, 4.73,0,0,0); else if(hour > 2&& hour < 3) return 0.14 + 0.28 * beta(6.88, 13.1,0,0,0); else if(hour > 3&& hour < 4) return normal(0.348, 0.0521,0); else return 9999999999999999999999;/**/ |
#6
|
|||
|
|||
Hi,
The only thing I can see from your code is on first line. It should be treenode current and not treenodecurrent. It is easier to see what the problem is if you send your model. Lars-Olof |
#7
|
|||
|
|||
Here is my updated version on barge test, as I just want to simulate 4 hours in this model with hourly distribution, so i try to use [if statement] to decide the arrival distribution patter. But it cannot generate any items.
If I change to arrival schedule, the model is correct. Many thanks for any advice. |
#8
|
|||
|
|||
Hi,
Try to change the code to this: Code:
if(hour >= 0 && hour < 1) return 0.3 + 0.2 * beta(2.19, 2.11,0,0,0); else if(hour >= 1 && hour < 2) return 0.25 + 0.24 * beta(2.73, 4.73,0,0,0); else if(hour >= 2 && hour < 3) return 0.14 + 0.28 * beta(6.88, 13.1,0,0,0); else if(hour >= 3 && hour < 4) return normal(0.348, 0.0521,0); |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Jack Lai (11-24-2011) |
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with the value of a label | Clement Schaller | Q&A | 3 | 03-15-2011 09:44 AM |
Add Label | Nischith Kashyap | Q&A | 4 | 03-14-2011 07:16 PM |
Record label | manuel fernandez | Q&A | 1 | 03-21-2010 12:29 PM |
how to set preempt by label? | Vic Li | Q&A | 4 | 10-19-2008 01:51 AM |
Checking to see if a label exists | Paul Dowling | Q&A | 3 | 04-28-2008 11:03 PM |