Example #1
0
        /// <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])));
        }
Example #2
0
 protected void insureDoubleVals()
 {
     if (doubles != null)
     {
         for (int i = 0; i < DoublesCount; ++i)
         {
             doubles[i] = EvolutionUtils.getLegalVal(doubles[i], 1.0);
         }
     }
 }
Example #3
0
 protected void insureShortVals()
 {
     if (shorts != null)
     {
         for (int i = 0; i < ShortsCount; ++i)
         {
             shorts[i] = EvolutionUtils.getLegalVal(shorts[i], maxShortVals[i]);
         }
     }
 }