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 > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 04-16-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default 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..
  #2  
Old 04-17-2013
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Default

You can use commands in a User Event, and then have this event repeat as often as you want. This may slow down FlexSim a little.
  #3  
Old 04-18-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

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  
Old 04-19-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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  
Old 04-19-2013
Ramesh Pinn Ramesh Pinn is offline
Flexsim User
 
Join Date: Oct 2012
Location: Tampa, FL
Posts: 16
Downloads: 0
Uploads: 0
Thanks: 12
Thanked 2 Times in 2 Posts
Rep Power: 93
Ramesh Pinn is on a distinguished road
Default

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  
Old 04-21-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

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  
Old 04-22-2013
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

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  
Old 04-22-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

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  
Old 04-24-2013
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
Default

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


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.