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 > Gripes and Goodies
Downloads

Gripes and Goodies Software problems and suggestions

  #1  
Old 09-16-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default Task Sequences

Hi all

I hope someone can help me with a problem I get if I create a task sequence.

At a certain event, i want to create a tash sequence with the FRLOAD.
In this function I need to tell the op what item he must load from the queue #XY.

My problem is at the time i create this task, i don't know which item he needs to fetch up. My idea was, to take this command....
first(Queue #XY)

but my problem is if there is no item(because it will arrive in 5 sec or so..) I get a bad pointer. Can i tell the op in the FRLOAD to get any item.

thanks Daniel
  #2  
Old 09-16-2010
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

Take a look at the CALLSUBTASK. That task gives you the possibility to create a new FRLOAD at the moment you are actually loading.
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post:
Gi Cha (09-16-2010)
  #3  
Old 09-20-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

Hi

thank you for your answer. I informed myself about the callsubtask by reading through your user guide. The one thing I don´t understand, is the last sentence of the following description:


If you decide to create the task sequence when the TaskExecuter gets to the call sub
tasks task, then you will need to create the task sequence using
createemptytasksequence(), and insert tasks using inserttask(), but do not dispatch
the task sequence using dispatchtasksequence(). Simply return the reference to the
task sequence.

How can i return this refernece an how do i get this reference. Which command do I need to programm?

Can u give me a code example to help me through this problem ?
I would very appreciate this. Thanks a lot

Daniel
  #4  
Old 09-20-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Just use :

return ts; or return tonum(ts);

where ts is a treenode pointer to your task sequence.
  #5  
Old 09-20-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

ok now i know how but,

a pointer to which task squence ?

the Task Sequence in my main task or the one in my Subtask ?

if i need to pointer at the task sequenz in my main task (as i thought) how do I access this treenode?

if I just need to return the treenode of the subtask ...all easy

thanks Daniel
  #6  
Old 09-20-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Yes it's just a pointer to the new tasksequence of (sub) tasks - it's just so the calling code (part of the TASKTYPE_SUBTASK execution logic) knows what you've created without searching for it - since you're free to create it on any dispatcher.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Daniel Schneider (09-20-2010)
  #7  
Old 09-20-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

thanks a lot !
  #8  
Old 09-23-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

Hi again,

still working on the task sequences of my projekt.

The next problem I have is, that i want to create a travel sequence. But only if there is no active task sequnece in the dispatcher.

Or so to say. If op is idle he should got to location the Queue#XY

Any idea how i get the content of the active task sequences in the dispatcher? Or how to solve this problem

I tried :>>>>>>content (Dipatcher/variables/tasksequneces);<<<<<<
but does not work

Thanks a lot Daniel
  #9  
Old 09-23-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Look at the OnMessage and OnAvailable triggers of the transporters in the model posted here.

Last edited by Jason Lightfoot; 09-23-2010 at 06:20 AM.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
shafizad (10-06-2010)
  #10  
Old 09-24-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

Hi i used the commands shown in this sample.. .it works , but i get a Error.

Code:
OnMessage (triggered by Subtask):
/**Check of new orders avail.*/
treenodecurrent = ownerobject(c);
pt("Check if there is something to do for operators");
pr();
if(
msgparam(1)==1) {

treenode newts =
createemptytasksequence(Dispatcher,0,0);
if(
not(objectexists(gettasksequence(Dispatcher,0)))){

pt("No order for op travel back to queue");
pr();
inserttask(newts,TASKTYPE_TRAVEL,centerobject(current,1),NULL);
}

else{
pt("New order for op ");
pr();
}
profiletasksequence(newts);
return newts;
}


Error:

time: 16013.336695exception: Exception Caught in gettasksequence(fsnode* dispatcher, double tsrank)
time: 16013.336695exception: Exception Caught in ObjectFunction103__project_exec_commandlist_gettas ksequence_node object: MAIN:/project/exec/commandlist/gettasksequence/node class: MAIN:/project/exec/commandlist/gettasksequence/node

Where is my mistake ? do I mistaken something ?
Thanks Daniel

PS: I use pt("") to debug and comment my code. I find i very usefull, cause you can see whats going on in your code, while the model is running. Reminds me of roboter contoller.
  #11  
Old 09-24-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Does it build correctly ? You seem to have no space after treenode in the definition of 'current'.
As it's on a trigger I'd try using tonum(newts).
To debug it just place a debugger breakpoint on a line by clicking in the margin (version 5 and above).
  #12  
Old 09-24-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

the missing space, is just a copy/paste error. In my code there is a space.

The code is working and the op's do what they are meant to do, but in the system console appears this error.

I already debugged the trigger. At this point there ist he pointer to current and the pointer to the newts. but no variables.

the function not(...) return what ???

In gernal such functions return data ..type boolean. Does Flexscript uses such a type?

Or does 0 equals true and 1 equals false??

Thanks Daniel
  #13  
Old 09-24-2010
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Daniel,

I think the way your code is setup, it will always create an empty tasksequence, but will only add a task, when there is no active task for the dispatcher.
If there is an active task for the dispatcher, you use the profiletasksequence(newts) command for an empty task (no task is inserted), I think this may be the problem.

I think you could solve this problem by only creating the newts when there is no active task:
if(not(objectexists(gettasksequence(Dispatcher,0)) ))
{
treenode newts = createemptytasksequence(Dispatcher,0,0);
inserttask(newts,TASKTYPE_TRAVEL,centerobject(curr ent,1),NULL);
profiletasksequence(newts);
return newts;
}


Esther
  #14  
Old 09-24-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

If you can't tell which line generates the problem by stepping though, you can use mpt(), mpf() and mpr() you can print to the same console as the error message and see exactly where you get the problem. Be sure to remove any of these statements before sending a model to Flexsim support though as they clutter the system console (I've been guilty of this before the debugger came along).

I usually add a dummy TASKTYPE_TAG to the task sequence rather than return an empty one or NULL, but it looks like returning NULL will also work.
  #15  
Old 09-24-2010
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: 1174
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

Quote:
Originally Posted by Daniel Schneider View Post
the function not(...) return what ???

In gernal such functions return data ..type boolean. Does Flexscript uses such a type?

Or does 0 equals true and 1 equals false??

Thanks Daniel
There is no "boolean" type in Flexscript, but you can use int or double for the same purpose. All of the Flexscript commands return int, double, treenode, or string.

A 0 value on an int or double is "false". Any other value is "true". Just like C++.

The function not() will return 1 if the expression inside resolves to 0. It will return 0 otherwise. You can use the ! symbol to do the same thing, just like C++.
  #16  
Old 09-27-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

I changed the code a esther said, but the error remains.

Thanks @ phil for the explanation concerning the True/false.
I´m programming in java... I ve never learned C++

As the program is working I leave the code as it is...

Other thing; A Questions concerning treenodes i have 2 stations and they are conected by treennodes. In the station i have a treenode every 1m. And between the two stations I have ony one treenode (distance about 100m). My worker has a max speed of 0.3 m/s. In the station the worker moves slowly and if he traveles to the other station he becomes very fast ?what is this ? Do in need to Place a treenode every meter ?
How is the speed defined in flexsim ?

thanks for support
daniel
  #17  
Old 09-27-2010
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: 520
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

Daniel,

You speak about treenodes in your stations, but I guess you mean NetworkNodes, right?
Or do you speak about FlowNodes?

I assume that you speak about NetworkNodes.
Normally the distance in Flexsim is measured by the grid, where 1 grid is 1 m.
But there is also the possibility on a NetworkNode to give a virtual distance between nodes. This means, if the distance between the NetworkNodes is e.g. 10 m in the grid, you can give it a Virtual Distance of e.g. 100m. This means that the speed will be adjusted to this virtual distance.
Maybe this happens in your model that you place them 100m away from each other, but your Virtual Distance is maybe only 10m.

The speed in Flexsim is defined on the taskexecuter (Operator). But between NetworkNodes also a speed limit can be defined. This means that the Operator will not move faster than this speed limit, even if his speed is higher.

You can get the current speed of an Operator with getvarnum(Operator,”maxspeed”). To set the speed you could use setvarnum(Operator,”maxspeed”,2.50).

I am not sure what is going on into your model. But please check the above things. If they are not the source of your problem, it might be helpful, if you post your model here or a small model which shows the problem with the distance and speed.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following User Says Thank You to Tom David For This Useful Post:
Phil BoBo (09-27-2010)
  #18  
Old 09-28-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

The problem with the networknodes, was solves by me by adding networknodes every 1 m.
It solved the Problem but as Tom David says this problem only occurs in my simulation....

By the way. Earlier we talked about felxscript and C++.
How is it possible to divide in flexscript?
If I divide 3 by 15 i want to get 0.2
If I do this division in flexscipt, I get 0.

in c++(java) I would cast it into a double
Can`t find any hint in the Flexsim Training

Any idea?
  #19  
Old 09-28-2010
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,

Flexscript get the result 0.2 when you do 3/15.

How do you to see the result from the division?
Printing using pd or pf?

pd will only print as integer while pf is printing as real.

Lars-Olof
  #20  
Old 09-28-2010
Daniel Schneider Daniel Schneider is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 20
Downloads: 0
Uploads: 0
Thanks: 4
Thanked 1 Time in 1 Post
Rep Power: 118
Daniel Schneider is on a distinguished road
Default

ok... thanks a alot

yes thats the fact. i print it with msg and numtostring


Thread Thread Starter Forum Replies Last Post
About Coordinated Task Sequences Normand Côté Gripes and Goodies 1 06-21-2008 06:08 AM
Queuing coordinated task sequences? Nico Zahn Q&A 19 04-02-2008 08:30 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.