article

Jason Lightfoot avatar image
6 Likes"
Jason Lightfoot posted Jason Lightfoot edited

Alternative getstream() to Accept Variants (.fsl autoinstall user command)

Good practice to reduce variance when experimenting is to separate streams of things that might vary in the model so that the random sampling is independent.

An example might be that you have a number of processors who are members of the same breakdown profile (MTBF/MTTR object) where the individual breakdowns are dependant on the state of the processor. If during one scenario a processor is used more than before then it may sample the duration and next breakdown earlier, and therefore change the sequence with the other machines sampling of breakdown times, increasing variance.

This is because the default setting for the MTBF time fields are using 'getstream(current)' - which means a single stream for the MTBF object, shared across all members.

You could try to change this in the MTBF by using 'getstream(involved)' where 'involved' refers to the breakdown member machine. This causes other problems since if you're sampling processing times using the machine's stream too, then the amount of items processed will again change the breakdown times samples. You may judge this to be acceptable, but in a ideal world you'd still want separate streams and may want multiple streams for setup, processing, breakdowns, or subsystem failures.

One way to accomplish this is by changing the way getstream() works such that it can generate a stream for any value you pass to it. That might be an object, as the current getstream() accepts, or it could be the string name of the object or it's path. It could also be an array which then opens a number of possibilities:

In a breakdown you could replace getstream(current) with

getStream([current,involved])   //generates a unique stream number for the MTBF/machine pair*

In an Object Process Flow you could replace getstream(activity) with:

getStream([current,activity])   // generates a unique stream for the instance and activity pair and works for the general process flow too.

For a processing time on a processor instead of getstream(current) you could use getstream([current,"Processing"]) and getstream([current,"Setup"]) to generate two seperate sampling streams.

The attached library contains an auto-installing user command that overrides getstream() to provide this functionality. The stream values save with the model.

getStream-byvariant3.fsl

* This implementation does have some limitations since during an experiment it does not communicate back the master model when trying to create new streams. For this reason you'll want to try and have all possible streams set up before running an experiment or avoid the type of actions that dynamically create the requirement for new streams - so that might be keeping all possible fixed resources and task executers, and hiding/removing them from groups rather than destroying them as the OnSet options of the parameters table do currently. Alternatively if you consistently name the dynamically created instances then the MTBF stream expression could be:

getStream([current, involved.name])


Update: I've edited this post and library to use getStream (capital 'S') since the override parameter (var thing) doesn't stay in place and eventually causes FlexScript build errors. So with the updated library you'll need to find/replace from the model tree 'getstream' with 'getStream'.

mtbf mttruser librarygetstreambreakdowns
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Article

Contributors

jason.lightfoot contributed to this article

Related Articles