/// <summary> /// returns a randomized short (a value that could have been generated in GenerateShorts() ), with max value of /// maxShortVals[i] /// </summary> virtual public ushort getGeneratedShort(int idx) { double factor = 2 * InitialValuesMeanFactor; ushort res = (ushort)EvolutionUtils.threadSafeRand.rand.Next(); res = EvolutionUtils.getLegalVal(res, maxShortVals[idx]); return((ushort)(Math.Min(res * factor, maxShortVals[idx]))); }
protected void insureDoubleVals() { if (doubles != null) { for (int i = 0; i < DoublesCount; ++i) { doubles[i] = EvolutionUtils.getLegalVal(doubles[i], 1.0); } } }
protected void insureShortVals() { if (shorts != null) { for (int i = 0; i < ShortsCount; ++i) { shorts[i] = EvolutionUtils.getLegalVal(shorts[i], maxShortVals[i]); } } }