Open jkomoros opened 2 years ago
Make the distribution a global variable. Have a config that includes the type, the clipMin, clipMax, etc.
Have an optionsConfig and a withUserValues that extends for any missing values and then sample (rnd)
const performanceQualityDistribution = new LinearDistribution({name: 'performanceQuality', description:'The quality of the performance', step: 0.05, min: 0.0, max: 1.0});
//in optionsConfig:
{
performanceQuality: performanceQualityDistribution.optionsConfig
}
And in the actual thing you need it, use the e.g.
performanceQualityDistribution.withUserValues(simOptions.performanceQuality).sample(rnd)
In the future, this would allow things like where you could have a Distribution that allows types to be picked by the user, where type is rendered as an option. e.g. LinearDistribution is just a Distribution, but with an option of types:['linear'], so the type selector is not rendered out in optionsConfig.
The one remaining minor todo isn't that important
Added a few TODOs so this s open again