public void SetPointValueTest() { DoubleEvaluation_Logarithmic target = new DoubleEvaluation_Logarithmic(); Point point = new DoublePoint(5); Point actual; actual = target.SetPointValue(point); double x = actual.Value - 3.2104019955684011; Assert.IsTrue(Math.Abs(x) < 0.0001); }
public void OperationsTest() { EvaluationIF e = new DoubleEvaluation_Logarithmic(); GeneticAlgorithm target = new GeneticAlgorithm(e); IList <Operator> expected = new List <Operator>(); SelectionIF S = new Selection_PercentAboveAverage(50); CrossoverIF C2 = new DoubleCrossover_Random(); MutationIF M = new DoubleMutation_ValuePercent(5.0); expected.Add(S); expected.Add(C2); expected.Add(M); IList <Operator> actual; target.Operations = expected; actual = target.Operations; Assert.AreEqual(expected, actual); }
public void DoubleEvaluation_LogarithmicConstructorTest() { DoubleEvaluation_Logarithmic target = new DoubleEvaluation_Logarithmic(); Assert.AreEqual(target.Type, OperatorType.Double); }