Esempio n. 1
0
        public void TwoDim_CorrectlyIdentifiesLegalSolution()
        {
            var evaluator = new Ellipsoidal(2);
            var ds        = evaluator.GetGlobalOptimum().GetDecisionSpace();
            var legal     = evaluator.GetLegality(DecisionVector.CreateFromArray(ds, new[] { 1.0, 1.0 }));

            Assert.True(legal);
        }
Esempio n. 2
0
        public void TwoDim_EvaluatesCorrectValues(double[] values)
        {
            var evaluator = new Ellipsoidal(2);
            var ds        = evaluator.GetGlobalOptimum().GetDecisionSpace();
            var result    = evaluator.Evaluate(DecisionVector.CreateFromArray(ds, new[] { values[0], values[1] }));

            Assert.Equal(values[2], result.ElementAt(0));
        }