jkomoros / CASsim

Complex Adaptive Systems Simulator
Apache License 2.0
21 stars 0 forks source link

Statistics and normal distibutions #48

Open jkomoros opened 2 years ago

jkomoros commented 2 years ago
jkomoros commented 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.

jkomoros commented 2 years ago

The one remaining minor todo isn't that important

jkomoros commented 2 years ago

Added a few TODOs so this s open again