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
|
|||
|
|||
how to create patients dynamically
Hi,
On previous versions there was a trigger option to create a patient from a track and start its activities... any idea on how to do this now?, the closest option i found is the create companion option... should i just use this one?.. regards Pablo |
#2
|
|||
|
|||
I have tried to create patient on reset. Just like creating flowitem, but you are using a patient object and put in the necessary track information.
David
__________________
Advent2 Labs David |
The Following User Says Thank You to David Chan For This Useful Post: | ||
Pablo Concha (04-01-2013) |
#3
|
|||
|
|||
Thanks David, i can make it work if the patient created start it's activities from the first, but when i try to start from a middle activity the patient starts the first one anyways besides the one i set wich gets me weird behavior or gets the patient stuck. Can you point me to wich variables i need to set when creating the patient so that he don't start always the first activity?...
regards Pablo |
#4
|
||||
|
||||
As you've already discovered, patients can be created on-the-fly by using the "Create Companions" picklist option found in several different triggers scattered throughout a model (e.g. Activity Finished Activity, Entry Trigger, Message Trigger, etc.). You may also use the createcompanion() command directly if you would like.
When a patient is created in this manner, there is a simply reference link made between the companion patient and the patient used to create the companion, but you do not have to use this link if you do not want to. If you do need to reference a companion, then use the getcompanion() command. When a companion is first created, the list of activities that have been predefined for the track used as the template to make the companion will be scanned. Any activities in the list which satisfy the predecessor, start time, and start condition requirements will begin. Typically, the first activity is the one with a blank predecessor list, so it is the one to start, but it does not need to be. If you do not want any of the activities to start, either give them all a bogus predecessor, or the better way is to uncheck the "Predecessors" box. If this is all old news to you, and you still are having problems with your first activity starting on companions when you first create them, please post your model and let me take a look. Cliff |
The Following User Says Thank You to Cliff King For This Useful Post: | ||
Pablo Concha (04-16-2013) |
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamically assigning 3D shapes to flowitems | Iulian Marin Ion | Q&A | 9 | 08-05-2013 08:17 PM |
Avoiding collisions with dynamically placed fixed resources | David Platt | Q&A | 3 | 05-15-2012 04:06 AM |
Changing Values of Variables Dynamically | naren nataraj | Q&A | 2 | 03-28-2012 05:55 AM |
Dynamically populate the timetable | Gleny Rodriguez | Q&A | 1 | 03-10-2010 05:42 PM |
How to dynamically set virtual distance for Network Node | Sung Kim | Q&A | 2 | 02-29-2008 01:36 PM |