コード例 #1
0
 public string[] GetMoveSet()
 {
     if (SimulatorMode == 1)
     {
         return(TestSimulator.GetCommandNames());
     }
     else
     {
         return((string[])InvokeDictionaryMethod(2, new object[] { }));
     }
 }
コード例 #2
0
        // Simulation Tester Methods
        public void InternalSimulatorSetup(bool LoggingState, InternalSimulator TestSimulator)
        {
            IDT.setStringArgs(TestSimulator.GetCommandNames());
            CC = new CommandCenter[TestSimulator.GetPlayerCount()];
            //int ThreadCount = Environment.ProcessorCount * 2;
            //int currentProcessor = 0;
            Thread[] GenerationThreads = new Thread[CC.Length + 1];
            int      CombinationLevel  = (int)IDT.getItem(3, 0, 0);

            for (int i = 0; i < CC.Length; i++)
            {
                CC[i] = new CommandCenter(IDT, "" + CommandCenterCount, LoggingState, this);
                CommandCenterCount++;
                SubCC(CC[i]);
            }
            BaseL = new CommandCenter(IDT, "" + BaseLineCCCount, "Baseline", LoggingState, this);
            BaseLineCCCount++;
            SubCC(BaseL);

            int[][] CommandSig = TestSimulator.GetCommandSignature();
            IDT.setIntArgs(CommandSig);
            RandomInput = new Randomizer((int)IDT.getItem(3, 0, 0));
            for (int i = 0; i < CC.Length; i++)
            {
                CC[i].GetArrays();
                CC[i].SetBounds(TestSimulator.ReturnRecommendedRange());
                CC[i].CreateClustersFromTemplate1();
            }
            BaseL.GetArrays();
            BaseL.SetBounds(TestSimulator.ReturnRecommendedRange());
            BaseL.CreateClustersFromTemplate1();
            int[][] DataSig = new int[1][];
            DataSig[0] = TestSimulator.GetDataSignature();
            IDT.setIntArgs(DataSig);
            string[] Names = IDT.getStringArgs()[0];
            for (int i = 0; i < CC.Length; i++)
            {
                CC[i].SetClusterNames(Names);
            }

            for (int i = -1; i < CC.Length; i++)
            {
                int temp = i;
                GenerationThreads[temp + 1] = new Thread(() => NodeCreation(temp, CombinationLevel, GenerationThreads[temp + 1]));
                GenerationThreads[temp + 1].Start();
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();
            UILog(this, CC.ToString());
        }