public void CorrectlyIdentifiesIllegalSolution() { var evaluator = new Zdt3(); var ds = DecisionSpace.CreateForUniformDoubleArray(30, -2, -1, -2, -1); var legal = evaluator.GetLegality(DecisionVector.CreateFromArray(ds, ds.Select(d => d.GetNextRandom(new SystemRandomSource())))); Assert.False(legal); }
public void CorrectlyIdentifiesLegalSolution() { var evaluator = new Zdt3(); var ds = evaluator.GetOptimalParetoFront(1).ElementAt(0).GetDecisionSpace(); var legal = evaluator.GetLegality(DecisionVector.CreateFromArray(ds, ds.Select(d => d.GetNextRandom(new SystemRandomSource())))); Assert.True(legal); }