Beispiel #1
0
 private void TestRegular()
 {
     for (int i = 0; i < 10; i++)
     {
         _simulationMaster.UpdateSimulation(25);
         CheckLights();
     }
     if (_simulation.Subscene.Vehicle.TimesPassedTrack >= 3)
     {
         _simulation.ForgetsToTurnLightsOff = true;
         _stage = Stages.TurnOffTime;
     }
 }
Beispiel #2
0
 public override void _Process(float delta)
 {
     if (_isExecutable)
     {
         // If timing is important (real hardware?) we might should use the
         // absolute system time instead of the relative delta time.
         _simulationMaster.UpdateSimulation(System.Convert.ToInt32(delta * 1000));
     }
 }
Beispiel #3
0
        public override void _Process(float delta)
        {
            int simulationSteps = LookupTargetSimulationCycles();

            for (int i = 0; i < simulationSteps; i++)
            {
                if (_isExecutable)
                {
                    _simulationMaster.UpdateSimulation(16);
                }
            }
        }
 private void Simulate()
 {
     SpawnTimeGenerator.SetLambda(_lambdaState);
     for (int i = 0; i < 300; i++)
     {
         _simulationMaster.UpdateSimulation(SimulatedCycleTime);
     }
     _lambdaState += 0.0002f;
     if (_lambdaState >= 0.1)
     {
         _testState = TestState.CalculateResults;
     }
 }
 /// <summary>
 /// Updates the step and collects the results
 /// </summary>
 public void UpdateStep()
 {
     if (_isExecutable && Result == -1)
     {
         _simulationMaster.UpdateSimulation(45);
         _simulatedSteps++;
         if (_simulatedSteps == 150)
         {
             _simulation.Vehicle.CarSpeed = VehicleAgentController.RegularCarSpeed;
         }
         if (_simulatedSteps >= 600)
         {
             CollectResults();
         }
     }
 }
 /// <summary>
 /// Updates the step and collects the results
 /// </summary>
 public void UpdateStep()
 {
     if (_isExecutable && Result == -1)
     {
         if (_simulatedSteps == 0)
         {
             _simulation.Vehicle.PlaceCarAt(VehicleAgentController.PathCheckpointCollisionStart + 0.02f);
         }
         _simulationMaster.UpdateSimulation(16);
         _simulatedSteps++;
         if (_simulatedSteps >= 600)
         {
             CollectResults();
         }
     }
 }
Beispiel #7
0
 /// <summary>
 /// Updates the step and collects the results
 /// </summary>
 public void UpdateStep()
 {
     if (_isExecutable && Result == -1)
     {
         for (int i = 0; i < 10; i++)
         {
             _simulationMaster.UpdateSimulation(16);
             if (_simulation.Vehicle.TimesPassedTrack == 5)
             {
                 _simulation.Guard.AllowVehiclePass = false;
             }
         }
         _simulatedSteps++;
         if (_simulatedSteps >= 600)
         {
             CollectResults();
         }
     }
 }
 private void SimulateStep()
 {
     if ((_simulatedSteps % 70) == 0)
     {
         _simulation.SimulationOutput.SetValue(GuardAgent.OpenGateSwitchKey, false);
     }
     if ((_simulatedSteps % 99) == 0)
     {
         _simulationMaster.Reset();
     }
     _simulationMaster.UpdateSimulation(50);
     if (_simulation.Vehicle.TimesPassedTrack == 5)
     {
         _simulation.Guard.AllowVehiclePass = false;
     }
     _simulatedSteps++;
     if (_simulatedSteps >= 600 * 5)
     {
         CollectResults();
     }
 }