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); }
public void TwoDim_CorrectlyIdentifiesIllegalSolution() { var evaluator = new Ellipsoidal(2); var ds = DecisionSpace.CreateForUniformDoubleArray(2, double.MinValue, double.MaxValue); var legal = evaluator.GetLegality(DecisionVector.CreateFromArray(ds, new[] { 11.0, -12.0 })); Assert.False(legal); }