Allow users to implement their own distributions

This commit is contained in:
Thorsten Sommer 2023-10-25 15:07:42 +02:00
parent 7d56951040
commit 3b62152957
No known key found for this signature in database
GPG Key ID: B0B7E2FC074BF1F5

View File

@ -16,7 +16,7 @@ public abstract class Distribution<TNum> : IDistribution<TNum> where TNum : IFlo
this.fitter = new ShapeFitter<TNum>(this.ShapeFunction, rng, 100); this.fitter = new ShapeFitter<TNum>(this.ShapeFunction, rng, 100);
} }
private protected abstract TNum ShapeFunction(TNum x); public abstract TNum ShapeFunction(TNum x);
public TNum GetDistributedValue(CancellationToken token = default) => this.fitter.NextNumber(token); public TNum GetDistributedValue(CancellationToken token = default) => this.fitter.NextNumber(token);