예제 #1
0
        public IEnumerator Evaluate(IBlackBox box)
        {
            if (optimizer != null)
            {
                optimizer.Evaluate(box);
                yield return(new WaitForSeconds(optimizer.TrialDuration));

                optimizer.StopEvaluation(box);
                float       fit     = optimizer.GetFitness(box);
                FitnessInfo fitness = new FitnessInfo(fit, fit);
                dict.Add(box, fitness);
            }
        }
    public IEnumerator Evaluate(IBlackBox box)
    {
        if (optimizer != null)
        {
            optimizer.Evaluate(box);
            hasEvaluated = false;
            while (BraidSimulationManager.ShouldBraidsEvaluate())
            {
                //Debug.Log("Evaluating");
                yield return(new WaitForSeconds(0.2f));
            }

            optimizer.StopEvaluation(box);
            float       fit     = optimizer.GetFitness(box);
            FitnessInfo fitness = new FitnessInfo(fit, fit);
            dict.Add(box, fitness);
            BraidSimulationManager.evaluationsMade++;
            hasEvaluated = true;
        }
    }