Cancel
Showing results for 
Search instead for 
Did you mean: 

Register data and attributes of the models

Creator
Creator

Hi everybody, I am using Plant Simulation for a course at my University. I am in trouble with registering some attribute and data from the model with some method to write it on a table. In my situation I have to register the random seed of each singleprocess I have in the production line and the final throughput taken from the drain object. How can I do that? 

 

Since I'm already there I ask a second question that I suppose is short: is there a "button" that changes the random seed of the stations? For example, I have to do 40 replications with differente RandomSeed and I would prefer to not change them manually.

 

Thanks!!!

4 REPLIES

Re: Register data and attributes of the models

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello,

 

concerning your first two questions, you could use a method similar to the subsequent one to accomplish this

 

 

TableFile.writeRow(1,1,SingleProc.RandomSeed)
TableFile.writeRow(1,2,drain.StatNumOut)

 

 

Concerning your last question, when you create a new object by e.g. inserting it into a simulation model, Plant Simulation automatically assigns a unique random number seed value to this object. So there is no button to change this value like for the Random Number Variant in the EventController. Eventually you will have to assign a new value with something similar to the following

 

SingleProc.RandomSeed:=SingleProc.RandomSeed+25

Of course you could run all of the above statements in a loop, provided that your stations are named in a generic way e.g. with ascending numbers at the end of their name. I hope this helps you to solve your problem, feel free to ask if you have any further questions regarding this.

Kind regards,

Igor
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution


Re: Register data and attributes of the models

Creator
Creator
Thanks, the collection of the RandomSeed and of the Throughput works properly.

For the second point, the change of the RandomSeed, I would like to make it automatized for all the stations. My stations are called with ascending numbers at the end (s1, s2, s3, etc...). Is it also possible to use a random number function multiplied to the 25 ( as in your example) to make the change more random? I t would be great also to randomly have a + or - in the operation, for example sum if the incoming number is even and subtract if it is odd. Hpwever, maybe I'm asking too much. Thanks!

Re: Register data and attributes of the models

Creator
Creator
I found out in the help of Plant Simulation that it is possible to change only the Random Numbers Variant of the Event Controller if you want to have different replications of the same model. Thus, I tried to change it and I found out that it changes the overall throughput and thus influence the stochastic state. I've also seen that there is the button that increments at each reset that is perfect for my case. I will thus use that, since in the help Plant Simulation recommend to do so.
However, I do not know how this Random Numbers Variant interact with the Random Seed and if you know it (basically) I would be really interested to know it.

Thanks!

Re: Register data and attributes of the models

Siemens Phenom Siemens Phenom
Siemens Phenom

I definitely agree that if you are looking for a way to run simulations that encompass stochastic components, with different outcomes for each simulation run, then this is the way to accomplish that. The outcome changes as, like you already described it, the Random Number Variant is changed with every reset if you activate that option in the Event controller. At this point it is important to know, that the Random Seed of an object together with the Random Numbers Variant of the Eventcontroller sets the seed values that are required for creating the random numbers of the respective object. So instead of changing the Random Seed of every single object in your model, it is definitely more convenient to just change the Random Numbers Variant of the Eventcontroller. This will affect the behavior of stochastic components of all objects in your model. If you want to restrict such a change only to certain objects, then you can just access and alter that objects Random Seed.

Kind regards,

Igor
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution