public void ContextAdaptationStep_AdjustMin_MinusOne() { var neuron = new NeoFuzzyNeuron(0, 1, 2); neuron.ContextAdaptationStep(-1); Assert.AreEqual(-1, neuron.XMin); }
public void ContextAdaptationStep_AdjustMax_10() { var neuron = new NeoFuzzyNeuron(0, 1, 2, alpha: 1); neuron.UpdateQ(0, 0.5, 2); Assert.AreEqual(-1, neuron.Q[0]); }
public void ContextAdaptationStep_AdjustMax_10() { var neuron = new NeoFuzzyNeuron(0, 1, 2); neuron.ContextAdaptationStep(10); Assert.AreEqual(10, neuron.XMax); }
public void ModalValuesAdaptation_AdjustActiveFunction() { var neuron = new NeoFuzzyNeuron(0, 2, 3, beta: 1); neuron.ModalValuesAdaptation(0.1, 1); Assert.AreEqual(0.1, neuron.B[1], 1e-5); }
public void MembershipFunctionsCreationStep_AddNewTermInternal_Right() { var neuron = new NeoFuzzyNeuron(xmin: 0, xmax: 2, m: 3, maxM: 10); neuron.MembershipFunctionsCreationStep(2, 0, 0.8, 50, 0, 0); Assert.AreEqual(4, neuron.Size); CollectionAssert.IsOrdered(neuron.B); Assert.AreEqual(2, neuron.B[^ 1]);
public void ModalValuesAdaptation_DoNotTouchBorder(int activeFunc) { var neuron = new NeoFuzzyNeuron(0, 2, 3, beta: 1); neuron.ModalValuesAdaptation(double.MaxValue, activeFunc); Assert.AreEqual(0, neuron.XMin); Assert.AreEqual(2, neuron.XMax); }
public void MembershipFunctionsElimination_RemoveCenter() { var neuron = new NeoFuzzyNeuron(xmin: 0, xmax: 2, m: 3, maxM: 10, ageLimit: 1); neuron.MembershipFunctionsElimination(0, 2); Assert.AreEqual(2, neuron.Size); CollectionAssert.IsOrdered(neuron.B); }
public void Setup() { _neuron = new NeoFuzzyNeuron(new[] { 0.0, 1.0, 2.0, 3.0 }, new[] { 1.0, 0, 0, 2.0 }); }