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
|
|||
|
|||
Continuously updating a label value
Hello guys.. I know Flexsim is a discrete event simulation (DES) software and moves form one event to next.. But I am trying to use agent based modeling methodology and I need to, somehow, have a continuously updating value.. That is I am trying to build a hybrid model using both DES and continuous simulation model.
The only thing that seems to move continuously is time. Is there any possible way or "way-around" to have a label value tied to Flexsim clock.. |
#3
|
|||
|
|||
I have tried that.. It still remains a discrete event no matter how small you make it. I ll probably have to have a user event for every single time unit in flexsim for it to behave as near continuous but that is not the ideal solution as it will make flexsim model run terribly slow. Moreover I was wondering if Flexsim is endorsed as an Agent based modeling tool as well it should have this feature.
PS: Any idea if Fluid objects can be used to model this kind of scenario. |
#4
|
||||
|
||||
I´m not quite sure why you want to update your label continously. Because flexsim runs as discrete event simulation, there would be no reason to update a label continously, because always you need a value, there will be an event!?
And if there is an event, you could update your label without slowing down model to much... Maybe just explain further what and why you are trying to do something like this.
__________________
Hemmi |
The Following User Says Thank You to Sebastian Hemmann For This Useful Post: | ||
Jörg Vogel (04-19-2013) |
#5
|
|||
|
|||
Maybe you can use the Custom Draw trigger of an object to do this? Custom Draw trigger is called every time the scene refreshes. I believe it is the fastest possible trigger (100s of ms??) when the model is running.
|
The Following User Says Thank You to Ramesh Pinn For This Useful Post: | ||
Phil BoBo (04-22-2013) |
#6
|
|||
|
|||
What I am trying to do is to visually demonstrate the amount of wait time an item has to go through waiting for an operator. So lets say an item turns from white to yellow after a certain amount of time waiting for operator and then orange and then red. There will be threshold times off-course. But the problem is how do I create a trigger for every single item that might be present in the model.
I hope my point has come across here. |
#7
|
||||
|
||||
That is easy. you take a controller object (or use the message trigger on any other object).
When your flowitem starts it's wait action you create a senddelayedmessage with the time the object has to change color as the sendobject. (e.g. senddelayedmessage( TheControllerObject, 3600, item, 10, 0, 0) which send a message to TheControllerObject after an hour with a 10 as first parameter to be able to make a distinction between messages ) And on this message you have a pointer to your item so you can do with it whatever your want (change color, size, appearance or change a label value) and on that message you create the next event when it has to change again. ( senddelayedmessage( TheControllerObject, 3600, item, 20, 0, 0) ) Be carefull, if it is possible that the flowitem no longer exists you have to build in an "objectexists" check |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Sebastian Hemmann (04-22-2013) |
#8
|
|||
|
|||
Well that sure sounds like a good way and thank you for that.
But there are a couple of more questions... Waiting for operator state begins when a request is sent to the operator for utilization but the operator has other tasks in its task sequence. In that case I believe I need to send a delayed message from the operator (or the dispatcher) to the item/processor holding that item. And if the item is still in the "Waiting for operator" state then apply the desired action otherwise not... So my question is if my logic (or the interpretation of you logic..!!) is correct or not ? Second if it is correct how exactly do I write this code (I am not sure how to deal with the dispatcher in this case.) |
#9
|
||||
|
||||
Hello,
the problem is to filter the last active message, if you send messages from different objects. You can build a time stamp system. You set a message parameter with the time the object sends the message. In the OnMessage trigger you check, if the incoming time stamp is valid. If you receive later on a delayed message with on older time stamp you know it is invalid. If you want to change the state of the item you can do it, when the Tasksequence is dispatched to fetch a Taskexecuter. To change the state again, you can insert a sendmessage task in the utilize tasksequence previous to the utilizetask. You can check the total number of task in the dispatcher in the Pass To Function. If it is equal to the standard length of a utilize tasksequence (4 Tasks) you insert a sendmessage task. It is now the last task in the tasksequence. Check if the tasksequence is not begun, look for the active task with the command getnroftasks. Then you can rerank the last inserted task to the 4th task rank of the tasksequence. The following should happen. On dispatching a tasksequence to call for an Operator, a message tells your controller to start counting the wait time and change the color in discrete time intervals by sending time stamped delayed messages by himself. The call for an Operator is received by an Dispatcher object. In the Pass To Function a Sendmessage TaskType is inserted and reranked to the 4th rank, previous to the utilizetask. When the taskexecuter send this message, he works at the processor. The state changes at the item again. Jörg |
Thread | Thread Starter | Forum | Replies | Last Post |
Updating Kinematic | FrankJanssen | Q&A | 4 | 12-20-2010 05:51 AM |
Using more than one TE continuously | Flavio Brito | Q&A | 5 | 06-11-2010 11:13 AM |
about model's continuously running | Frans Zeng | Q&A | 10 | 05-21-2010 12:47 AM |
Continuously Move | Li Chin | Q&A | 12 | 10-13-2008 03:49 AM |
Updating Labels | Naresh Yamani | Q&A | 7 | 03-28-2008 11:28 PM |