コード例 #1
0
        public void InitUncertaintyManager(Variation m_variation)
        {
            variation     = m_variation;
            possibilities = CalculatePossiblities();
            int[] array = new int[variation.NumberOfFacesToMove()];
            arrayLength = array.Length;
            variations  = new List <int[]>();
            CalculatePermutation(array, ref variations, depth, array.Length);


            //Debug Part
            Console.WriteLine("Permutations: ");
            string mstring = "";

            foreach (int[] arrayElement in variations)
            {
                for (int i = 0; i < arrayElement.Length; i++)
                {
                    mstring += arrayElement[i] + " ";
                }
                mstring += "\n";
            }
            Console.WriteLine(mstring);

            //foreach (int number in arrayElement)
            //    Console.WriteLine(number);
            //Console.ReadLine();
        }
コード例 #2
0
 /// <summary>
 /// Calculates the number of floors needed to have a permutation of each flor
 /// </summary>
 /// <param name="numberOfFacesToWorkOn"></param>
 private int CalculatePossiblities()
 {
     return((int)Math.Pow(depth, variation.NumberOfFacesToMove()));
 }