void SetConfirmation()
 {
     if (integrationState == IntegrationStates.integrating)
     {
         integrationState = IntegrationStates.confirmation;
         Events.CloseSubMenu();
         SetStateScreen();
     }
 }
 public void SetAnswer(string s)
 {
     count.color = Color.white;
     count.text  = respuesta.text;
     answer      = float.Parse(respuesta.text);
     Debug.Log(respuesta.text);
     integrationState = IntegrationStates.integrating;
     respuesta.text   = "";
     Game.Instance.levelManager.LevelShapeShow(false);
     SetStateScreen();
 }
        /// <summary>
        /// Sets up for the specified simulation.
        /// </summary>
        /// <param name="simulation">The simulation.</param>
        /// <exception cref="SpiceSharp.CircuitException">Could not extract solver</exception>
        public virtual void Setup(TimeSimulation simulation)
        {
            var solver = simulation?.RealState?.Solver;

            if (solver == null)
            {
                throw new CircuitException("Could not extract solver");
            }
            IntegrationStates.Clear(i => new IntegrationState(1.0,
                                                              new DenseVector <double>(solver.Order),
                                                              StateManager.Build()));
        }
        /// <summary>
        /// Destroys the integration method.
        /// </summary>
        public virtual void Unsetup()
        {
            StateManager.Unsetup();

            // Clear the timesteps and solutions
            IntegrationStates.Clear((IntegrationState)null);

            // Clear variables
            Order    = 0;
            Slope    = 0.0;
            BaseTime = 0.0;
            Time     = 0.0;
        }
        /// <summary>
        /// Continues the simulation.
        /// </summary>
        /// <param name="simulation">The time-based simulation</param>
        /// <param name="delta">The initial probing timestep.</param>
        public virtual void Continue(TimeSimulation simulation, ref double delta)
        {
            // Allow registered methods to modify the timestep
            var args = new ModifyTimestepEventArgs(simulation, delta);

            OnContinue(args);

            // Shift the solutions and overwrite index 0 with the current solution
            IntegrationStates.Cycle();
            BaseTime = Time;

            // Update the new timestep
            IntegrationStates[0].Delta = args.Delta;
        }
 public void Init()
 {
     integrationState     = IntegrationStates.question;
     targetMaterial.color = originalTargetColor;
     SetStateScreen();
 }
 public void NextExcersice()
 {
     Game.Instance.board.Clear();
     integrationState = IntegrationStates.question;
     SetStateScreen();
 }