示例#1
0
        public LayerInfo MoveNeuron(int from, int to)
        {
            if (from == to)
            {
                return(this);
            }

            if (to < 0)
            {
                to = 0;
            }
            else if (to > neurons.Count - 1)
            {
                to = neurons.Count - 1;
            }

            if (from < 0)
            {
                from = 0;
            }
            else if (from > neurons.Count - 1)
            {
                from = neurons.Count - 1;
            }

            NeuronInfo temp = neurons[to];

            neurons[to]   = neurons[from];
            neurons[from] = temp;

            return(this);
        }
示例#2
0
        public LayerInfo AddNeuron(NeuronInfo neuron, int pos)
        {
            neurons.Add(neuron);
            if (pos >= 0 && pos < neurons.Count - 2)
            {
                MoveNeuron(pos, neurons.Count - 1);
            }

            return(this);
        }
示例#3
0
 public LayerInfo AddNeuron(NeuronInfo neuron)
 {
     neurons.Add(neuron);
     return(this);
 }