For some reason my post was rejected by the system so I'll try again.
I have encountered something I cannot wrap my head around. Either it's me doing something wrong or misunderstanding how something works, or it may be a problem with Plant Simulation I haven't seen anyone encounter yet.
I recently had a situation in Plant Simulation where 5 computers were involved. The specifications of the computers was as follows. The differences are marked in bold. The manufacturer of the SSD's and RAM was different but I figured this shouldn't play a role anyway, so they are shown as the "same".
Computer 2, 3, 4 = same Plant Simulation installation media, same OS, CPU, RAM and SSD (the computers are identical)
I now have access to Computer 1 and Computer 5 in a controlled environment to show what I mean in the screenshots below. The only difference between the computers should be the hardware and OS. The simulation models should be exactly the same, per the windows I have opened in the model files to verify that. We can also see that the predecessors and successors are exactly the same in both models, so the objects are connected in the same order.
The models were built individually, so I didn't create the .spp on computer 1 then copy it to computer 5. Computer 1 made the model from scratch, and so did computer 5.
As you can see, the output of the model is not the same. In fact it differs by quite a lot (841 vs 906), despite using the exact same object settings and same plant simulation version. Only the hardware and OS is different.
As an additional example, I tried running both Plant Simulation v13.1 and 13.2 side by side on Computer 5 and also got varying output despite using the same object settings:
Is there something I am doing wrong or shouldn't the output of both models be exactly the same?
They are built in the exact same workflow sequence
It is not the most complex model, but I would expect that in this scenario, the output should be the same regardless of which PC we are using, but it is not.
I cannot figure out why this is! The varying output also occurred between PC's 1-4 (the identical ones), but since this may have been down to user error I tested this myself in a controlled environment which is the result of the screenshots.
Solved! Go to Solution.
You probably inserted the objects in a different order into the two models, so the objects do not have matching RandomSeed values between the two models. I suggest you compare the models via "File > Compare Models". This is the easiest way to find differences between the two models.
Perfect, you learn something new every day! I did not know each object generated its own unique randomSeed value.
I now see the Plant Simulation Help has a very good explanation of how this works -> "Simulating Random Processes"
However, for a training environment where participants are following a specific workflow to model a simple line and analyze output (that should correspond to the teacher's model) - how would this be solved the best? It wouldn't be practical to use an init-method to set the randomSeed value individually for each object.
Is there a way to set the randomSeed value of the object that has just been dragged in? Also, how would failure profiles behave - do they generate the same sequence of random numbers using the same randomSeed attribute of the object or do they have their own randomSeed attribute to generate failures from?
Thank you also for a previous explanation I found here: https://community.plm.automation.siemens.com/t5/Plant-Simulation-Forum/Created-objects-has-invalid-R...
I would generally advise not to change the RandomSeed values manually. Plant Simulation automatically assigns a unique RandomSeed value to each object. If you assign a different value, you need to take care of this (otherwise objects could generate the same random numbers). For training purposes you could provide a Method that initializes the RandomSeed values of the objects during the Reset or Init phase. Or you could define a constructor control in class and set the RandomSeed value in this control.
As long as you insert the objects in the same order, the objects will get the same RandomSeed values, and therefore the simulation results will be the same. So setting the RandomSeed values manually should actually not be necessary. Note that if you delete an object and then insert a new one of the same kind, the new object will have a different RandomSeed value.
Each failure profile not only uses its own random number stream, but also uses a unique seed value. The RandomSeed value of an object is a 32-bit value. Internally the MRG63k3a random numbers generator uses a 384-bit random seed value that Plant Simulation computes from the 32-bit value. So Plant Simulation can easily compute a unique seed value for each failure profile. Each failure profile of each object will internally have a different 384-bit seed value and will therefore generate a different sequence of random numbers. They are also different from every sequence of processing and set-up times in the model. The random numbers generated by the SimTalk z_ functions are also always different from these times.
Thank you very much for the advice and thorough explanation, this helped me a lot in my understanding of how Plant Simulation works under the hood!