private double GetRandomisedValue(double minimum, double maximum)
        {
            if (rng == null)
            {
                throw new NotSupportedException("A random number generator was not provided. This hyper-cube cannot be randomized");
            }
            Random random = rng.CreateRandom( );
            double delta  = maximum - minimum;

            return(minimum + random.NextDouble( ) * delta);
        }
 public LatinHypercubeSampling(IRandomNumberGeneratorFactory rng, TSysConfig template, int nDiv = 5)
 {
     this.rng  = rng;
     this.rand = rng.CreateRandom();
     if (!template.SupportsThreadSafeCloning)
     {
         throw new ArgumentException("This URS factory requires cloneable and thread-safe system configurations");
     }
     this.template = template;
     this.hcOps    = new HyperCubeOperations(rng.CreateFactory());
     this.nDiv     = nDiv;
 }
Exemplo n.º 3
0
 public WeibullGen(IRandomNumberGeneratorFactory rng, TSysConfig template)
 {
     this.template = template;
     random        = rng.CreateRandom();
 }
Exemplo n.º 4
0
 public LumpedAWBMFactory(RiverSystemScenario scenario, IRandomNumberGeneratorFactory rng)
 {
     this.scenario = scenario;
     this.random   = rng.CreateRandom();
     GetMetaParameterSet();
 }