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 > Flexsim Student Forum
Downloads

Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook.

  #1  
Old 11-21-2011
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default 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?
Attached Thumbnails
Click image for larger version
Name:	success using arrival schedule.jpg
Views:	160
Size:	146.1 KB
ID:	1566   Click image for larger version
Name:	error occur when using inter-arrival time.jpg
Views:	142
Size:	94.0 KB
ID:	1567  
Attached Files
File Type: fsm barge.fsm (57.2 KB, 121 views)
  #2  
Old 11-22-2011
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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  
Old 11-24-2011
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default

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  
Old 11-24-2011
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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  
Old 11-24-2011
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default

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  
Old 11-24-2011
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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  
Old 11-24-2011
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default

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.
Attached Thumbnails
Click image for larger version
Name:	inter-arrival time.jpg
Views:	134
Size:	146.1 KB
ID:	1568  
Attached Files
File Type: fsm barge_4hour.fsm (61.6 KB, 118 views)
  #8  
Old 11-24-2011
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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);
Lars-Olof
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


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.