Cancel
Showing results for 
Search instead for 
Did you mean: 

Processing Time from Table

Pioneer
Pioneer

Trying to use a table to control Processing times of multiple Single Proc.  

 

Current Method is below:

 

SingleProc.ProcTime:=TableFile[2,1]
SingleProc1.ProcTime:=TableFile[2,2]
SingleProc2.ProcTime:=TableFile[2,3]

 

this is an example but I have more than three machines to control.  What is the language to read down the table getting the machine name and tie from the Y dimension?

8 REPLIES

Re: Processing Time from Table

Experimenter
Experimenter

Hello,

 

There are different ways to set up your model depending on the level of granularity you need, and how you want the input data to flow into the model. Below is a simplistic way that assumes the processing time a specific station is constant and independent of the MU that is being processed there.

 

table_lookup.png

 

The processing time formula is: 

ProcessingTime["Time Minutes", @.Name]

Note that the table is indexed using the column name and row name, not the integer index. This enhances readability while (slightly) increasing model run time. It is preferable to use this approach as long as it isn't critical to optimize the model run time performance.

 

Notes:

  • Each SingleProc will get its ProcTime the same way. This is done dynamically when an MU is about to be processed and asks the SingleProc for a ProcTime (or, in software-independent language, the duration to wait until the scheduled end-of-service event). You can just copy the formula to the other SingleProc objects. Perhaps a better way is to create a new class that is duplicated or derived from SingleProc, representing one of these stations. The class prototype will store this formula, and each instance you insert into the model will inherit that feature. At the end of the day it will result in much less copying and pasting on your part, and less chances for you to make a mistake in doing so.
  • It is not good practice to hard code the names of your SingleProcs in the method source code. You will find that this produces tedious programs with poor readability that are very difficult to maintain or to communicate to other modelers. Instead, make liberal use of the anonymous identifiers that are provided in SimTalk (e.g. @, ?, root, self).
  • To relax those assumptions above the image, we would need to add further imbellishments, and more dimensions of data. Nested subtables or SQLite query language may be very helpful in those cases. If you can describe your application in a bit more detail, there could be a better solution for your modeling need.

 Best regards,

Andrew

 

Re: Processing Time from Table

Pioneer
Pioneer

I have attached the test Model.  I actually was trying to write a method to vary the SingleProc to not hard code in the method.  I am willing to try your solution but I am getting an error.  

 

Thank you.

Re: Processing Time from Table

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

two things: the name of the station you should write into the row index (so you can use the names as keys for the row), in the SingleProc you need to set for the process time: formula (instead of constant)

The formula is:    TableFile[1,?.name]

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Processing Time from Table

Pioneer
Pioneer

it is only reading the first line of the table how would i index down through the table

Re: Processing Time from Table

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
open the table, activate the row index (Tab list - Rowindex)
Write into the column 0 (rowindex) the names of the SingleProcs.
Than you can address the right row with the name of the singleProc:
TableFile[1,"SingleProc"]

If you use a formula, you can use "?" to access the object --> ?.name is the name of the object
so the formula is:

tableFile[1,?.name]

So Plant Simulation finds "automatically" the right row.
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Processing Time from Table

Pioneer
Pioneer

I apologize I just spent some time running with different times.  Thank you.

Re: Processing Time from Table

Pioneer
Pioneer

One last question.  Can I input a distribution in this manner, have a specific one for each Operation in the Table?

Re: Processing Time from Table

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

yes you can

you need to define several columns for the values of the distribution. Then you can use one of the z_... functions to set the value based on the values of the distribution in the formula

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net