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 > Tips and Tricks
Downloads

Tips and Tricks Share helpful modeling ideas

  #1  
Old 11-05-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 collision of Task excecuter

Hi again,i got the problem, that i want to avoid the collision between two task excecuters. My goal is, to send a 2 task excecuter to a queue an they shoud not collide and the second one arriving at the queue shout wait till the next one leaves the point.I know , that i can use a few networknodes and programm on the OnContinue and OnArrival trigger to close the nodeedges. But this is not what i want, cause every time i want to change the network i need to create new networknodes.Is theere a way to create such scenario? For example with the collision sphere. Can someone help me ?Thanks
  #2  
Old 11-05-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

This should be possible by setting the network node capacity to 1 and making the paths non-passing.

There's an example here.
  #3  
Old 11-05-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

This script will set up all taskexecuters and network nodes in the model


forobjecttreeunder(model()){
if (isclasstype(a,CLASSTYPE_NETWORKNODE)){
setvarnum(a,"maxinactive",1);
for (int n=content(connectionsout(a));n>0;n--)
settablenum(connectionsout(a),n,3,3); //set the paths to non-passing
}
else if (isclasstype(a,CLASSTYPE_TASKEXECUTER)){
setvarnum(a,"useoffsets",2); //set to blocking network space and no offsets
}
}
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post:
Daniel Schneider (11-05-2010)
  #4  
Old 11-05-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

nice code thanks !!i want to realize this scenario. A taskexcecuter should travel in a cricle and wait at a few networksnodes. I thought the easiest way is to call stopobject(taveler) on the on Arrival trigger and the resumeobject onMessagebut i get following error:time: 64.564531exception: Exception Caught in NetworkNode:ushtraveler(fsnode* reqnode, NetworkNode* tonetnode, int nextport)time: 64.564531exception: Exception Caught in NetworkNode::receiveinputrequest(fsnode* reqnode, int port, int lastport) object: /NN13time: 64.564531exception: Exception Caught in NetworkNode::nnrelease(fsnode* reqnode) object: /NN14time: 64.564531exception: Exception Caught in NetworkNode::OnTimerEvent(fsnode *involved, int code, char *datastr) object: /NN14time: 64.564531exception: Exception Caught in ObjectFunction201__project_library_FlexsimObject_b ehaviour_eventfunctions_OnTimerEvent object: /NN14 class: /NN14Is there a easier way to do this ?thanks for all helpDaniel
  #5  
Old 11-05-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

Try stopping the operator in a delayed message of 0 time. It may be a timing issue.
The Following User Says Thank You to Phil BoBo For This Useful Post:
andrecorreia (05-14-2013)
  #6  
Old 11-07-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

Oh thanks,

sure this could be. I'll try it like this

OnArrival:
senddelayedmessage to current with id of op ,time = 0 and msgparam(1)=1

OnMessage:
msgparam(1) ==1 -> stopobject(id of op); senddelayedmsg to current time=20s and msgparam(1)=2
*****
msgparam(2) resumeobject.

I cant access the model right now, so i'll try this tomorrow and report the success.

Does anyone have a code idea for this one. I ll have a idea but this idea would be huge amount of programming.
I have a number in a table and i want to create this amount o task executer at the beginnig of the Simulation(latter on by inserting this number in a GUI). For all taskexecuter there is a centerport to the disatcher and a normal port the networknode they should start.

The problem i had was. I created one TaskExcecuter and on reset of the Simulation I copy this Task excecuter with a for loop.
But after the Simulation this amount of Task excecuters are still there. So i need to destroy them somehow... Does anyone have a easy idea how to do this?

Thanks for your help

Daniel
The Following User Says Thank You to Daniel Schneider For This Useful Post:
arunkrmahadeva (10-11-2013)
  #7  
Old 11-07-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

This post had a dispatcher with a variable for the number of operators, it might help.....
  #8  
Old 11-08-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,by using senddelayed message and stopobject i was able to stop the task excecuter. The problem is altough i set all networknodes as non-passing, the Taskexcecuters pass through the stoped task excecuter. That makes no sense to me...
  #9  
Old 11-08-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

Moreover if the other task excecuters trie to pass through the stopped one..after passing is they dont use the networkpath but the dircert way to the next node... ? is the stopobect command wrong? is there a better way realize this ?
  #10  
Old 11-08-2010
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
Red face

Hi Daniel,

Do you have a look at the traffic control object?

Another way to stop task executers is to give them something different to do with a higher priority, e.g. a utilize task or waittask.
  #11  
Old 11-08-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

Daniel by stoppinging the task executer you are pre-empting them with another task sequence (of higher priority)- this takes them off the network, which is also why other travelers can pass by them. When they resume they travel to the next network node, but without obeying the path constraint.

You said you wanted them to travel in a circle and wait at some network nodes - you could just issue TASKTYPE_TRAVEL jobs with the network node as involved1 and between them use either TASKTYPE_DELAY if they resume themselves or TASKTYPE_UTILIZE if something else resumes them (with freeoperators()). This way they would not leave the network and so should block others (if the max travelers of the netnode is 1).
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Phil BoBo (11-08-2010)
  #12  
Old 11-08-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 Jason,thanks for your answer. giving the Taskexcecuter the task maually was something i want to avoid. Because at the monent its just a circle but later on there will be parallel station with errors... and so on. Giving the Task a the beginning or with subtask..is a bit... i dont know complicated?I thought this would be a easy scenario I could handle with a few programming steps.... is there no other command to stop a task excecuter while traveling on a networknode...without pre empting his tasksequence? I trieded to set speed a 0 but didn't work...PS: How can i delete all task excecuters in model?? I tried it like this ..but my flexsim crashed.forobjecttreeunder(model()){ if (isclasstype(a,CLASSTYPE_TASKEXECUTER)){destroyobj ect(a);}
  #13  
Old 11-08-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 Jörg,no i never used the traffic control i'll have a look at it. Giving the Task excecuter a waiting task isnt the same a stopping it ?
  #14  
Old 11-08-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

As you all sugessted i did it by creating the task sequences on my own and it is working.But my Flexsim is still crashing when i use this command to destroy the Task excecuters i create at the beginning of the simulationforobjecttreeunder(model()){ if (isclasstype(a,CLASSTYPE_TASKEXECUTER)){destroyobj ect(a);}}
Moreover i want to edit the spacing in the networknodes the same way jason told me by inserting a code in the script. But i cant find the variable in the Tree.



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.