示例#1
0
        CreateNewInnovation(int inID, int outID, InnovationType type)
        {
            SInnovation innovation = new SInnovation(inID, outID, type,
                                                     m_NextInnovationID++);

            if (type == InnovationType.NewNeuron)
            {
                innovation.NeuronID = m_NextNeuronID++;
            }

            m_vecInnovations.Add(innovation);

            return(m_NextNeuronID - 1);
        }
示例#2
0
        CheckInnovation(int inID, int outID, InnovationType type)
        {
            for (int i = 0; i < m_vecInnovations.Count; i++)
            {
                SInnovation innovation = m_vecInnovations[i];
                if (innovation.NeuronIn == inID &&
                    innovation.NeuronOut == outID &&
                    innovation.Type == type)
                {
                    return(innovation.ID);
                }
            }

            return(-1);
        }
示例#3
0
        CreateNewInnovation(int from, int to, InnovationType type,
                            NeuronType neuron_type, float x, float y)
        {
            SInnovation innovation = new SInnovation(from, to, type,
                                                     m_NextInnovationID++,
                                                     neuron_type, x, y);

            if (type == InnovationType.NewNeuron)
            {
                innovation.NeuronID = m_NextNeuronID++;
            }

            m_vecInnovations.Add(innovation);

            return(m_NextNeuronID - 1);
        }
示例#4
0
        CreateNeuronByID(int id)
        {
            SNeuronGene clone = new SNeuronGene(NeuronType.Hidden, 0, 0, 0);

            for (int i = 0; i < m_vecInnovations.Count; i++)
            {
                SInnovation innovation = m_vecInnovations[i];
                if (innovation.NeuronID == id)
                {
                    clone.Type   = innovation.neuronType;
                    clone.ID     = innovation.NeuronID;
                    clone.SplitY = innovation.SplitY;
                    clone.SplitX = innovation.SplitX;

                    return(clone);
                }
            }

            return(clone);
        }