Exemplo n.º 1
0
 internal void ErrorCheck()
 {
     foreach (Cell l in cells)
     {
         l.ErrorCheck();
     }
     if (classBits.BitsToString().BinaryStringToInt() >= OptoGlobals.NumberOfClasses)
     {
         classBits = classBits.RerollBitArray(OptoGlobals.RNG);
         ErrorCheck();
     }
 }
Exemplo n.º 2
0
        public String HumanReadableChromosome()
        {
            StringBuilder ret      = new StringBuilder();
            int           affinity = affinityBits.BitsToString().BinaryStringToInt();

            ret.AppendLine("\tThis chromosome " + affinityStrings[affinity]);
            ret.AppendLine("\tIt focuses on problems in the following class:");
            int Classes = classBits.BitsToString().BinaryStringToInt();

            ret.AppendLine("\t" + OptoGlobals.ClassList[Classes]);
            ret.AppendLine("\tBy aggregating the " + (notFlag?"nay":"yes") + " votes from the following " + NumCells + " cell" + (NumCells > 1?"s:":":"));
            foreach (Cell temp in cells)
            {
                ret.AppendLine("\t" + temp.HumanReadableCell());
            }
            return(ret.ToString());
        }
Exemplo n.º 3
0
 //decoding functions
 public string BitsAsString()
 {
     return(_bits.BitsToString());
 }
Exemplo n.º 4
0
 public override String ToString()
 {
     return(_bits.BitsToString());
 }
Exemplo n.º 5
0
        public static string BitsToString(this BitArray a, uint start, uint end)
        {
            BitArray ret = Range(a, start, end);

            return(ret.BitsToString());
        }