ATTENTIONThis 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 |
#1
|
|||
|
|||
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
|
|||
|
|||
This should be possible by setting the network node capacity to 1 and making the paths non-passing.
There's an example here. |
#3
|
|||
|
|||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
|||
|
|||
This post had a dispatcher with a variable for the number of operators, it might help.....
|
#8
|
|||
|
|||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
|||
|
|||
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);}
|
#14
|
|||
|
|||
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. |