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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default one question about tasksequence?

if i write code like these "treenode ts =createemptytasksequence(centerobject(current,1),0 ,0);
inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
inserttask(ts,TASKTYPE_FRLOAD,item,current,port);
inserttask(ts,TASKTYPE_BREAK,NULL,NULL);
inserttask(ts,TASKTYPE_TRAVEL,outobject(current,1) ,NULL);
inserttask(ts,TASKTYPE_FRUNLOAD,item,outobject(cur rent,1),opipno(current,1));

dispatchtasksequence(ts);"in some trigger.
can i find "ts " in the tree?
if in other trigger i want to reference "ts",How should I do ? thank you ?
Reply With Quote
  #2  
Old 08-05-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 514
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

ts is a reference to the node you create with createemptytasksequence(). With inserttask() you insert additional nodes into the first node. This whole tree construct is your tasksequence. With dispatchtasksequence() you transfer the part of the tree into the taskexecuter or dispatcher.
In the taskexecuter you can see the tree under activetasksequence. Here it is shown which tasksequence he is doing in the moment and which task he is just in.
So to refer to these nodes you can do it by pointing to the activetasksequence.
If the taskexecuter has other tasksequences they can be found in the tasksequencequeue node in the tree under variables.

To be honest, I do not understand why you want to do this and what are you trying to do.
In the moment I get the impression, that some people here in the community try to understand the deepest inside of Flexsim. In a way that might be interesting, but to work with Flexsim you do not need to understand all this stuff. Why not just work with the standards and take some things as they are?
What can be the reason to understand what are all the pointers, what the nodefunction is doing as long it does what I want. To mess around in the tasksequences?
I am working now more than three years with Flexsim and was able to build my models without understanding the deepest inside of Flexsim.
Why not just building models with the standard and simulate?
Okay, maybe I got something wrong here, but in the moment I really wonder about some questions. Maybe it would be helpful if people would write what they are going to do and why they think they need to know all this stuff.
I do not need to understand what Word is doing behind the scenes as long as I am able to write text and can print it ...
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
Reply With Quote
  #3  
Old 08-05-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

because i do not know how use inserttask(obj tasksequence, TASKTYPE_BREAK , null, obj involved2 )(especial, involved2)? can you give me a example?
Attached Files
File Type: zip 2.zip (38.3 KB, 199 views)

Last edited by Tom David; 08-06-2009 at 01:31 AM. Reason: Useless Quote
Reply With Quote
  #4  
Old 08-05-2009
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: 484
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

???,

First, it would be nice if you would fill out the "about me" section of your profile so that we could know who we are helping out. Like, what your name is.

The break task type will execute the "Break To Requirement" function. This is unless the involved1 or involved2 objects are specified. If involved1 is sprecified then instead of calling the taskexecuters "Break To Requirement" function a message will be sent to the object specified. This way you can have the break to logic on one object if you have many operators. If the involved2 object is specified then it is assumed that it is a straight reference to the task sequence that the TaskExecuter should break to.

You should never specify both parameters. It is an either/or type of deal.

What I explained above is covered in more detail in the user manual if you look under Task Types.

Good Luck,
Brandon
__________________
thats not normal.
Reply With Quote
  #5  
Old 08-05-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Question

thank you ,i fill out the "about me".my name is xu linwei ,i am chinese flexsim agent strategic partner.
"If the involved2 object is specified then it is assumed that it is a straight reference to the task sequence that the TaskExecuter should break to."
how reference to the task sequence ,in same trigger,or in other trigger?can you give me example?

Last edited by Tom David; 08-06-2009 at 01:31 AM. Reason: Useless Quote
Reply With Quote
  #6  
Old 08-06-2009
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1169
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

If you look at the Command documentation and sort it by category, there is a section called TaskExecuter Object. The commands in that section are used in conjunction with task sequences. The command you are looking to use is probably gettasksequence().
Reply With Quote
  #7  
Old 08-07-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

Brandon i do not this view is right.
"The break task type will execute the "Break To Requirement" function.
This is unless the involved1 or involved2 objects are specified."

in my model the involved1 or involved2 objects are not specified but execute the "Break To Requirement" function.
my code is like this,i set var1 1,it executes the "Break To Requirement" function
treenode ts = createemptytasksequence(centerobject(current,1),0, 0);

inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
inserttask(ts,TASKTYPE_FRLOAD,item,current,port);
inserttask(ts,TASKTYPE_BREAK,NULL,NULL,1,0);
inserttask(ts,TASKTYPE_TRAVEL,outobject(current,po rt),NULL);
inserttask(ts,TASKTYPE_FRUNLOAD,item,outobject(cur rent,port),opipno(current,port));

dispatchtasksequence(ts);


i do not know why,and i also confused involved2 ("a straight reference to the task sequence")
i use gettasksequence(). but it is not work

view http://www.flexsim.com/community/for...read.php?t=718
Attached Files
File Type: zip ts8.zip (39.3 KB, 190 views)
Reply With Quote
  #8  
Old 08-08-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 514
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

I do not understand what you are trying to do and why you think you need to understand invovled2.
As said in the manual you normally use involved1 or involved2. Using invlovled2 can be also directly done where you create the original tasksequence. So why do you think you need to use involved2. As far as I see the whole thing in 99,9 percent of the times you will use involved1 or the standard NULL, NULL.

So please try exactly to describe what you are trying to do and why do you think that you need to use invovled2.
What is working in your attached model and what is not working. Where do you think you have an issue?
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
Reply With Quote
  #9  
Old 08-08-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

I just want to understand invovled2. I think you know more flexsim,you'll be more flexible use of flexsim,I think I will use it in the future. Thank you Tom David
Reply With Quote
  #10  
Old 08-11-2009
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 729
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Here is a completely contrived example of using involved2 in a break task:

Code:
treenode ts1 = createemptytasksequence(te, 0,0);
inserttask(ts1, TASKTYPE_TRAVEL, station1);

treenode ts2 = createemptytasksequence(te, 0,0);
inserttask(ts2, TASKTYPE_LOAD, someitem, station1);

inserttask(ts1, TASKTYPE_BREAK, NULL, ts2);
dispatchtasksequence(ts1);
You would never do this in real life because you might as well just insert the load task directly into ts1. However, the case where you might need to use this is when ts2 has already been created previous to the execution of this code. So instead of creating ts2 here, you would be referencing some task sequence either in your own queue:

Code:
treenode ts2 = gettasksequence(current, 1);
or in some globally accessible dispatcher's task sequence queue:

Code:
treenode ts2 = NULL;
for(int i = 1; i <= content(gettasksequencequeue(globaldispatcher)); i++)
{
   if(some criterion is met)
   {
      ts2 = gettasksequence(globaldispatcher, i);
      break;
   }
}
Reply With Quote
The Following 3 Users Say Thank You to Anthony Johnson For This Useful Post:
Brandon Peterson (08-11-2009), Carsten Seehafer (08-12-2009), Tom David (08-11-2009)
  #11  
Old 08-11-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Smile

Thank you Anthony Johnson ,l write code like this ,it does not work and have something wrong,i do not know why
treenode ts = createemptytasksequence(centerobject(current,1),0, 1);

inserttask(ts,TASKTYPE_TRAVEL,current,NULL);
treenode tss=gettasksequence(centerobject(current,1),3);
inserttask(ts,TASKTYPE_DELAY,NULL,NULL,1);

inserttask(ts,TASKTYPE_FRLOAD,item,current,port);
inserttask(ts,TASKTYPE_BREAK,NULL,tss,1,0);
inserttask(ts,TASKTYPE_TRAVEL,outobject(current,po rt),NULL);
inserttask(ts,TASKTYPE_FRUNLOAD,item,outobject(cur rent,port),opipno(current,port));

dispatchtasksequence(ts);

and can you help me about this question http://www.flexsim.com/community/for...ead.php?t=1024
Attached Files
File Type: zip ts7.zip (61.7 KB, 184 views)
Reply With Quote
  #12  
Old 08-12-2009
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: 484
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

I have attached a sample model that illustrates what you were trying to accomplish. The code is in the "Request Transport From" trigger.

There were two keys to getting this to work. First, for the Break task to be executed the first variable needs to be something other than 0 or the maximum content of the Task Executer must be greater than it's content at the time of the Break task. Second, in my example it was very important for the priority of the task sequence that included the Break task to be greater than the task I wanted to break to. If not the Break to task sequence would sometimes be executed prior to the task sequence with the Break task in it (See Example).

Good Luck,
Brandon
Attached Files
File Type: zip Break Task.zip (35.1 KB, 203 views)
__________________
thats not normal.
Reply With Quote
  #13  
Old 08-12-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

sorry,it does not i want to do ,i want to get break tasksquence from other trigger,not the same trigger ,so can you give me example use gettaskquence() command from tasksquence Produced by other trigger ?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove a tasksequence from a tasksequencequeue? AlanZhang Q&A 11 10-19-2007 03:50 PM


All times are GMT -6. The time now is 07:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.