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); }
public LayerInfo AddNeuron(NeuronInfo neuron, int pos) { neurons.Add(neuron); if (pos >= 0 && pos < neurons.Count - 2) { MoveNeuron(pos, neurons.Count - 1); } return(this); }
public LayerInfo AddNeuron(NeuronInfo neuron) { neurons.Add(neuron); return(this); }