// 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()); }
public void SingleCommandCenterSetup(bool InitialLoggingState) { CC = new CommandCenter[1]; CC[0] = new CommandCenter(IDT, "" + CommandCenterCount, InitialLoggingState, this); CommandCenterCount++; SubCC(CC[0]); int temp = (int)IDT.getItem(3, 0, 0); int[][] CommandSig = TestSimulator.GetCommandSignature(); IDT.setIntArgs(CommandSig); RandomInput = new Randomizer((int)IDT.getItem(3, 0, 0)); CC[0].GetArrays(); CC[0].SetBounds(TestSimulator.ReturnRecommendedRange()); CC[0].CreateClustersFromTemplate1(); int[][] DataSig = new int[1][]; DataSig[0] = TestSimulator.GetDataSignature(); IDT.setIntArgs(DataSig); CC[0].GetArrays(); CC[0].MakeNodeClusterGetArrays(); if (RecalculateFlag) { CalculateCombinations(temp, DataSig); } CC[0].GenerateNodes(UntrimmedCombinations); CC[0].SetPlayMode(PlayMode); CC[0].SetPlayerMode(PlayerMode); GC.Collect(); GC.WaitForPendingFinalizers(); UILog(this, CC.ToString()); }