public override void _Process(float delta) { int simulationSteps = LookupTargetSimulationCycles(); for (int i = 0; i < simulationSteps; i++) { switch (_testStep) { case TestStep.Deploy: TestStepDeploy(); break; case TestStep.Power: case TestStep.FirstOff: case TestStep.FirstOn: case TestStep.SecondOff: case TestStep.SecondOn: case TestStep.Wait: _testStep = _testCases[_testStep].Check(_testStep); break; case TestStep.Both: TestStepBoth(); break; case TestStep.Report: TestStepReport(); break; } if (_isExecutable) { SimulationMaster.UpdateSimulation(16); } } }
private void setupMainWindow() { this.network = new Network(workerMode, ipAddress); master = new SimulationMaster(this, this.network, this.simplePath); master.setClusterSize(clusterSize); List <Agent> agents = MapSync.getProducedAgents(); setWindowSize(master.getMapHeight() + 200, master.getMapWidth() + 100); setUpCanvas(master.getMapHeight(), master.getMapWidth()); numAgents.Text = "" + master.getNumAgents(); ipTextBox.Text = "" + ipAddress; }
/// <summary> /// Initializes the whole twat viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; Simulation = GetNode <CircularSawModel>("ViewportContainer/Viewport/CircularSawModel"); SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation); if (SimulationMaster != null) { Simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = SimulationMaster.IsProgramSimulationValid(); SetupTestSteps(); } else { _isExecutable = false; } }
/// <summary> /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; Simulation = GetNode <MassTestChamber>(_testChamberPath); SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation); if (SimulationMaster != null) { Simulation.InitialiseWith(mainNode, openedLesson); IsExecutable = SimulationMaster.IsProgramSimulationValid(); } else { IsExecutable = false; } PaperLog = GetNode <PaperLog>("PaperLog"); PaperLog.Setup(); TestController = new TestController(this); TestController.Setup(); }
void Awake() { simulationMasterScript = Camera.main.GetComponent <SimulationMaster> (); }