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 06-11-2014
Simon Jutz Simon Jutz is offline
Flexsim User
 
Join Date: Nov 2013
Location: Innsbruck/Austria
Posts: 33
Downloads: 29
Uploads: 0
Thanks: 25
Thanked 5 Times in 4 Posts
Rep Power: 83
Simon Jutz is on a distinguished road
Default Content of an object - itemtype specific

Hi all!

I have a question regarding the command "content":

Is there a way to read out particular (itemtype specific) items from one object that contains several itemtypes?

In my model the production line contains one queue ("WS2") that can contain several itemtypes. This queue WS2 is the successor stage of several other queues that constantly release items to this queue. Splitting up WS2 into itemtype specific queues is not possible (that would solve my problem I know). In the OnExit Trigger of the object I want to define a variable that counts me the actual number of flow items of a particular itemtype. This variable will be used for futher calculation.

I write:
Code:
treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);
treenode WS2;
WS2=node("/WS2", model());
int WS2content = content(WS2);
Obviously the variable WS2content will contain the total number of items independent of the itemtype. How can I precisely define the itemtype specific content of an object?

Thank you for your help in advance!!!

Best wishes!
Simon
  #2  
Old 06-11-2014
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Simon,

there are two basic options to do this:
1. Count every single item entering or leaving by itemtype. I did that for the queue in the model attached. It has three labels, one for each itemtype and the labels are updated OnEntry and OnExit. The advantage is, that you always have accurate figures for each itemtype without calculation.
2. Only count when you need an actual number. I created a user command ("Tools/User Commands") which you can call from anywhere in the model with an object to search and and itemtype you are looking for. It runs through the content of the object and adds up flow items with the matching itemtype. You can call the sample in the script window. This will be slower than option 1. for large queues and frequent calls.

Let us know, if that helps you.

Best wishes
Ralf
FlexSim
Attached Files
File Type: fsm 20140611_ContentByItemtype.fsm (14.5 KB, 45 views)
The Following 6 Users Say Thank You to RalfGruber For This Useful Post:
Tom David (06-12-2014)
  #3  
Old 06-11-2014
arunkrmahadeva's Avatar
arunkrmahadeva arunkrmahadeva is offline
CCS, India
 
Join Date: Sep 2013
Location: India
Posts: 71
Downloads: 67
Uploads: 0
Thanks: 285
Thanked 101 Times in 51 Posts
Rep Power: 145
arunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rough
Default

Hi Simon,

Here is a solution illustrating your requirement.

Regards,

Arun KR
Attached Files
File Type: fsm Itemtype.fsm (15.7 KB, 34 views)
The Following User Says Thank You to arunkrmahadeva For This Useful Post:
Simon Jutz (06-12-2014)
  #4  
Old 06-12-2014
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 Simon,

you can give the function: forobjecttreeunder(obj.) { }
a try, too. You find more information in the command manual.

Jörg
The Following 4 Users Say Thank You to Jörg Vogel For This Useful Post:
Simon Jutz (06-12-2014)
  #5  
Old 06-12-2014
Simon Jutz Simon Jutz is offline
Flexsim User
 
Join Date: Nov 2013
Location: Innsbruck/Austria
Posts: 33
Downloads: 29
Uploads: 0
Thanks: 25
Thanked 5 Times in 4 Posts
Rep Power: 83
Simon Jutz is on a distinguished road
Default

Thank you guyy for the many replies!

I have choosen the first way Ralf proposed me! It works fine and I can now calculated with this information!

Related to this, I have a further question:

As I said, I define several variables to make the following query:
Code:
treenode FGI7;
treenode WS2;
treenode ProductionLine2;
FGI7=node("/FGI7", model());
WS2=node("/WS2", model());
ProductionLine2=node("/ProductionLine2", model());
int WS2content = getlabelnum(WS2, "Product7");
int ProductionLine2content = getlabelnum(ProductionLine2, "Product7");
int FGI7content = content(FGI7);
int I7content = content (current);
int Reordered = getlabelnum(current, "Reordered");
int ReorderPoint = getlabelnum(current, "ReorderPoint");
int ReorderQuantityP7 = getlabelnum(current, "ReorderQuantityP7");
treenode SourceRaw = centerobject(current, 7);
// FIRST CHECK CAN'T HAPPEN BEFORE INITIAL CONTENT IS IN FGI
if((time() > 1) && (I7content + WS2content + ProductionLine2content + FGI7content + Reordered) <= ReorderPoint)
{
	senddelayedmessage(SourceRaw, 0, current, ReorderQuantityP7);
}
The tricky point is in the "if" command: Currently the query if the ReorderPoint is undershot is done continuously (time()). I am interested to do this periodically (say each 10 or 20 time units) and not continuously. How can I rewrite this line? I want this command in the OnExit Trigger of my object. Sure, there would be a way to integrate this in a UserCommand but I have several identical objects (queues) for different item types.

Thanks again for your help!

Simon
  #6  
Old 06-12-2014
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Simon,

time() doesn't mean the code is executed continuously. It only replaces time() with the current simulation time at the point this function is called. If you put the code on an exit trigger it will be fired on exit only.
If you want it to be fired timebased you can do either one:

- Create a UserEvent with a repeat interval or
- Send a delayed message on the object itself and in the messagetrigger you send the delayedmessage again with the delaytime being your check interval

Here's the question: The beauty of discrete event simulation is, that you can use events to execute functionality when the system changes. Time based calls actually are using a lot of CPU performance, even when there are no changes in the system. Unless the real time system does time based calls (which a KanBan does not do, returning KanBan cards in general triggers events) I can see no reason to use time based calls in your model.

Please explain a little more, what you try to achieve.

Thanks

Ralf
FlexSim
  #7  
Old 06-12-2014
Simon Jutz Simon Jutz is offline
Flexsim User
 
Join Date: Nov 2013
Location: Innsbruck/Austria
Posts: 33
Downloads: 29
Uploads: 0
Thanks: 25
Thanked 5 Times in 4 Posts
Rep Power: 83
Simon Jutz is on a distinguished road
Default

Well, it is more a question of argmentation of the model design in my case. With very short interval in my demand process I can argue a "continuous" demand pattern, although it is technically quite difficult to implement. Therefore the small time intervals. I THOUGHT that the query I have shown is time-continuous and that these two modeling strategies are difficult to propose (a almost continuous demand process and a classical continuous review process).

Now, I know more. So each time an item leaves the object the stock level is checked. Thus it is actually a PERIODIC review system, right?

I won't change anything by now I think and will put my thoughts together to see how things can be explained reasonably.

Thanks!!
The Following User Says Thank You to Simon Jutz For This Useful Post:
RalfGruber (06-12-2014)


Thread Thread Starter Forum Replies Last Post
Process Maximum Content (depends on itemtype) shafizad Q&A 4 03-04-2015 07:53 AM
Periodic Pull Strategy - itemtype specific Simon Jutz Q&A 20 06-14-2014 04:44 AM
Dashboard Graph Content vs Time for Fluid object Abdul Mirza Q&A 3 05-10-2013 08:29 AM
Specific Path for TaskExecuters Scott Mullen Flexsim Student Forum 5 03-25-2013 03:32 AM
closing specific port# George Serhan Q&A 3 01-07-2013 05:17 AM


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.