Пример #1
0
        private void FillLandscape(LandscapeFilling lf)
        {
            Action <int> fill = null;

            switch (lf)
            {
            case LandscapeFilling.QuadraticFunction:
                fill = FillLandscapeQuadratic;
                break;

            case LandscapeFilling.ValueOfBinary:
                fill = FillLandscapeValues;
                break;

            case LandscapeFilling.Random:
                fill = FillLandscapeRandom;
                break;
            }

            if (fill == null)
            {
                return;
            }

            for (int i = 0; i < S; i++)
            {
                fill(i);
            }
        }
Пример #2
0
 protected RandomBase(int L, int S, LandscapeFilling lf)
     : this()
 {
     this.L = L;
     this.S = S;
     FillLandscape(lf);
 }
Пример #3
0
 public MonteCarlo(int L, int S, int N, LandscapeFilling l) : base(L, S, l)
 {
     landscapeFilling = l;
     this.N           = N;
 }