Exemple #1
0
    public IEnumerator GetValuesFromDendrites()
    {
        SourceLobe.FireNeuron(0);
        SourceLobe.Process();
        DestLobe.Process();

        var FiringNeurons = DestLobe.GetFiringNeurons();

        Assert.AreEqual(1, FiringNeurons.Count);

        yield return(null);
    }
Exemple #2
0
    public IEnumerator GetValue()
    {
        var          DynamicsGene = new DendriteDynamicsGene(1, 0, 0, null, 0, null, 0, null, null, 0);
        DendriteGene DendriteGene = new DendriteGene(0, 0, DendriteGene.SpreadType.Flat, 0, new Vector2Int(0, 0), new Vector2Int(5, 5), new Vector2Int(1, 1), DynamicsGene);
        TestDendrite Dendrite     = new TestDendrite(0, 0, DendriteGene);
        NeuronGene   NeuronGene   = new NeuronGene(0, 0, 0, null);
        Lobe         lobe         = new Lobe(0, null, new Vector2Int(0, 0), new Vector2Int(5, 5), Enumerable.Range(0, 25).Select(n => new Neuron(n, NeuronGene)).ToList(), false, false);

        lobe.FireNeuron(0);
        Dendrite.SetSourceLobe(lobe);
        Dendrite.MockSTW(1);
        var DendriteValue = Dendrite.GetValue();

        Assert.AreEqual(1, DendriteValue);

        Dendrite.MockSTW(255);
        DendriteValue = Dendrite.GetValue();
        Assert.AreEqual(255, DendriteValue);

        yield return(null);
    }