Cancel
Showing results for 
Search instead for 
Did you mean: 

Random Date and Related Attributes Generation

 Hi everyone, 

 

I have 6 different systems for my simulation and 9 different parts associated. I would like to generate them randomly in simtalk and record them on a table. To be more spesific; 

 

System  A    300 Sales in one year

 

With every System A = 2* PartB + 1* PartC + 1* PartD

 

System B     200 Sales in one year

 

With every System B = 1* Part A + 1* Part E + 1* PartG

 

 

I want to generate them with the exact dates for example : 

Delivery Date            System Type         Part A  Part B   PartC  PartD  PartE   PartG        

01.02.2016                System A                 0        2           1       1          0          0

05.02.2016                System B                 1        0           0       0          1          1

 

 

 

Does anyone have experience with random date generation and/or a sample model or I would open to any suggestions ?

 

 

Thank you very much !

4 REPLIES

Re: Random Date and Related Attributes Generation

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

see the example

- create for the systems the entries, copy the parts from a BOM into the table

- at the end sort the complete table by date

 

 

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

Re: Random Date and Related Attributes Generation

Hi , 

 

Thank you very much. It helped me to generate my orders randomly. However, I have a new questions rised up after I have implemented the logic to my model. I have modified your example a bit , in order to set the orders out monthly.I have created a table, where I entered the monthly amounts of orders, but probably I am having an issue with looping or setting the intervals. Could have a look at the modified code in the attachment ? 

 

My other question is, let's say I also know the possible number of BOMs to be demanded throughout the year. In the current configuration, I am assigning with coefficients but would it be possible, to enter the total amount and assign them with a distribution or randomly to the Systems ? To give a more concrete example ; 

                                            Part A  Part B Part C Part D Part E Part F Part G

System A                                 0         2          1       1       0          0        0 

System A                                 0          1         0        1      0          0        0 

System B                                 1          0         0       0       1          1        1

 

 

 

Total number of Part A : 200

Part B: 400

 

etc. 

 

 

and Part A goes between (0 to 2) with every System B

      Part B goes between (0 to 2) with every System A

      Part E goes between (0 t0 1) with every System A

 

 

 

I would be happy with a logic or the closest and fastest  way I can get to this. 

 

Last edit for Montlhly_Bbom_11 added.

 

Thank you very much ,

 

Erkan

     

Re: Random Date and Related Attributes Generation

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I cannot edit your model.

 

One possible way could be to create orders like above and "dice" the numbers of parts  (see help: z_normal, z_uniform).

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

Re: Random Date and Related Attributes Generation

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Erkan,

 

your question contains two sub-problems (if I have correctly understood):

  1. You need a random datetime and a random amount of type integer.

  2. You simulation of the random datetime seems to be correct in your model.

I made a suggestion for the simulation of the random integer value:

A random integer from 0 to m can be generted by

 

local n:integer := z_uniform(99, 0, m+1);

 

The attached model for Plant Simulation 12 can be opened by all licenses.

 

Regards,

Peter