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); float avgSpeed = optimizer.GetAvgSpeed(box); FitnessInfo fitness = new FitnessInfo(fit, fit, avgSpeed); dict.Add(box, fitness); } }