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-05-2012
Peter Walters Peter Walters is offline
Process Engineer
 
Join Date: Jun 2012
Location: San Diego, CA, USA
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
Peter Walters is on a distinguished road
Default Percent choice for GlobalTaskSequence

Hello! I am having some trouble with my model, and would love any advice I can get.

In my model, there is one source, and ultimately three destinations for the material to be moved to. The transporter must perform a number of activities along the way to each destination. There are fixed percentages for which items will be sent to which destination, and three transporters to perform the work.

In attempt to model this, I wrote three seperate globaltasksequences (one for each destination). I then tried to incorporate the dispatch of the task sequence into a percentage script. (Script shown below).

The problem I keep having is that all three transporters are moving and behaving together as one unit, instead of as three seperate units.


I have attached a demo of the model to work with (and see whats happening). The script I am executing:


treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);
// establish random percent conditions
double percent1 = 80; // Queue 3 at 80%
double percent2 = 95; // Queue 4 at 15% (sum)
double percent3 = 100; // Queue 5 at 5% (sum)
double randomnum = uniform(0,100,1);

//define all percent case task sequences
string tsname1 = /**/"Q3_Delivery"/**/;

string tsname2 = /**/"Q4_Delivery"/**/;

string tsname3 = /**/"Q5_Delivery"/**/;

treenode dispatcher = /**/Dispatcher15/**/;
/** \nDynamic Parameter 1: */
treenode dp1 = /**/item/**/;
/** \nDynamic Parameter 2: */
treenode dp2 = /**/current/**/;
/** \nDynamic Parameter 3: */
treenode dp3 = /**/outobject(current, port)/**/;
/** \nDynamic Parameter 4: */
treenode dp4 = /**/NULL/**/;
/** \nDynamic Parameter 5: */
treenode dp5 = /**/NULL/**/;

treenode ts1 = createglobaltasksequence(tsname1, dispatcher, dp1,dp2,dp3,dp4,dp5);

treenode ts2 = createglobaltasksequence(tsname2, dispatcher, dp1,dp2,dp3,dp4,dp5);

treenode ts3 = createglobaltasksequence(tsname3, dispatcher, dp1,dp2,dp3,dp4,dp5);

//globaltasksequence case pick by percentage
if( randomnum<=percent1)
dispatchtasksequence(ts1);
else if( randomnum<=percent2)
dispatchtasksequence(ts2);
else if( randomnum<=percent3)
dispatchtasksequence(ts3);

return 0;


Thanks for any help!
Attached Files
File Type: fsm Percent GTS.fsm (38.3 KB, 72 views)
  #2  
Old 07-05-2012
syseo's Avatar
syseo syseo is offline
Flexsim User
 
Join Date: Aug 2007
Location: Korea
Posts: 290
Downloads: 439
Uploads: 0
Thanks: 249
Thanked 63 Times in 41 Posts
Rep Power: 211
syseo has a spectacular aura aboutsyseo has a spectacular aura about
Default Hi. Peter. Your model display three transporters to move indenpendently.

I tested your model.

What's the meaning of your saying 'like one unit'?
Three transporters is moving to three destinations indenpently each other.
I attach the snap shot.

I did not touch any part your model in V6.0.

Please check it again.
Attached Thumbnails
Click image for larger version
Name:	Indepentent moving in Global Task Sequence.jpg
Views:	78
Size:	15.7 KB
ID:	1849  
  #3  
Old 07-05-2012
Peter Walters Peter Walters is offline
Process Engineer
 
Join Date: Jun 2012
Location: San Diego, CA, USA
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
Peter Walters is on a distinguished road
Default

They all three start moving at the same time, and only one of them will actually have loaded the item (other two just move on without it).

After posting I saw the same thing you saw, and determined that it is because the supply queue is dispatching all three task sequences at the same time, instead of by the percent distribution I was trying to do. I think its because there is nothing telling the script to stop executing after the first "if", and so for any number under 80 it will execute all three task sequences.

I fixed the problem by having the supply queue distribute to three individual queues at the percentages I wanted, and then had each of those supply via a dedicated global task sequence. This seems to have solved the problem, but I would still be curious to see if there was a way to handle this all with a single script. Something like what I was trying to do, but done properly
  #4  
Old 07-06-2012
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

Without looking at your model, have you thought about a CALLSUBTASK? Then every tasksequence can make individual decisions based on the status of the objects when your reach a certain point in your tasksequence.
  #5  
Old 07-06-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Peter,
everything is fine with your code. If you want to execute only one tasksequence you have to dispatch only one tasksequence. Everytime a Flowitem enters the queue and it can be released a tasksequence is dispatched. To release only one tasksequence close the output of the Queue when you dispatch a tasksequence. The next item entering the queue stays there as long as the output port is closed.

Jörg



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.