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 |
|
Downloads |
Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook. |
#1
|
|||
|
|||
Problem with task sequences and inexplicable NULLs
I have a simulation problem dealing with the escort requirements of a special education department within a local elementary school. Many of the students require escort from the bus to the classroom, and many of them require varying levels of support in getting into the building. As a result of this, staff can transport some students in arbitrarily sized groups, and some students can be transported only in pairs and some students can be transported only singly by staff.
Each student is a unique entity (treated in simulation as a flowitem), and can only be generated once. To address the above problem, I have a table (“StudentTable”) which contains the canonical attributes of each student, including (column 3) the maximum size group with which a student may be escorted, (column 4) the service rate distribution to deliver the student from arrival point to destination and (column 5) a flag indicating whether or not the student has been generated yet in the current simulation run. The mechanism in simulation that I use to deliver students/flowitems is a Task Sequence controlled by a by an OnResourceAvailable trigger attached to a “PrincipleDispatcher”. Load, delay , and unload tasks simulate pickup and delivery of students. As an example of how this would work, suppose I had 3 students for whom the service distributions might produce the resulting values of 30 seconds, 5 minutes, and 10 minutes. Initially, 3 load tasks load the 3 students, followed by a delay of 30 seconds, delivery of student1, a delay of 4:30 seconds (i.e. 5 minutes-30seconds) , delivery of student2, and a delay of 5 minutes (10 minutes-5minutes), and finally delivery of student 3. Obviously, I need to sort students within a set based on the magnitude of their delivery time. I thus use a table (“TempTable”) in conjunction with a treenode array containing student flowitems—it would be easier to store a reference to flowitems within TempTable, and only use one datastructure, but I don’t think that’s possible. TempTable rows individually refer to students within the current set being transported. The 3 columns within TempTable are 1) studentid (the ordinal location within StudentTable that the current row in TempTable refers to) 2) service time (produced from a service time distribution stored as a string within StudentTable 3) the original index within the treenode array of student flow items. After sorting TempTable based on service time, I use the original index within column 3 to find the corresponding student/flowitem within the treenode array described in the first sentence of this paragraph. The problem which has been causing me to virtually pull out my own hair, is that the dispatchtasksequence call that I have issued near the end of the OnResourceAvailable trigger complains that the flowitem parameter within Task 4 is NULL. I call profiletasksequence on the line immediately preceding and profiletasksequence claims that the corresponding task and parameter is a valid Person class flowitem. If I were to make a guess, I would assume that such unpredictable behavior might be due to wild pointers within FlexSim shooting things that they are not supposed to shoot. Is there anything that the scripter (i.e. me) is supposed to do within my attached flexsim model to ensure that the model behaves appropriately? I am running Flexim 7.5.0 (student license) and I have a copy of documentation relating to FlexSim 7.1 which states that a Request Transport From trigger needs to return 1 “to avoid serious problems”. I have not seen a Request Transport From anywhere within 7.5.0—is this something to do with the pull logic of fixed resources? Is Request Transport From no longer relevant with respect to 7.5.0? Has it been renamed? Lastly, is there a cleaner approach to the above problem other than the implementation I describe? I will attach the flexsim model with which I am having problems to this message or to the thread. Thanks, Dean Fitzgerald |
#3
|
|||
|
|||
Simply picking up the same student twice
Dean,
The problem is that you are having each of the task sequences that you created pick up the exact same student. You can see this by setting the name of the students in the OnExit trigger using: setname(item,concat(getname(item),numtostring(geto utput(current)))); After doing this you will see that all 3 task sequences that you create are to pick up the same students. These 3 task sequences then get passed to 3 different operators and all 3 try at the same time to pick up the same 2 students. Because of this, when one of them tries to pick up one of the students, that student is no longer there (it was picked up by another operator). This is why when you profile the task sequence the student is there (no students have been picked up) but when the task sequence gets executed, the student is missing. You may want to flag the students using labels (or something like this) when you create the task sequence so that you don't accidentally pick up the same student more than once. Hope this helps and good luck! |
The Following 3 Users Say Thank You to Dustin Derrick For This Useful Post: | ||
sagar bolisetti (04-17-2015) |
Thread | Thread Starter | Forum | Replies | Last Post |
How to get number of task sequences in queue for a Task executor? | mearjun | Q&A | 3 | 06-14-2014 12:41 PM |
coordinated task sequences | Shahin Gelareh | Q&A | 2 | 02-20-2012 01:36 AM |
Task Sequences | Daniel Schneider | Gripes and Goodies | 20 | 09-28-2010 07:30 AM |
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 |