/** * This will connect the specified unit to be an input to this unit. * @param i The unit. * @param n It's connection number for this connection. * @return True if the connection was made, false otherwise. */ protected boolean connectInput(NeuralConnection i, int n) { //the function that this overrides can do most of the work. if (!super.connectInput(i, n)) { return false; } //note that the weights are shifted 1 forward in the array so //it leaves the numinputs aligned on the space the weight needs to go. m_weights[m_numInputs] = m_random.nextDouble() * .1 - .05; m_changeInWeights[m_numInputs] = 0; return true; }
/** * This will connect the specified unit to be an input to this unit. * @param i The unit. * @param n It's connection number for this connection. * @return True if the connection was made, false otherwise. */ protected boolean connectInput(NeuralConnection i, int n) { //the function that this overrides can do most of the work. if (!super.connectInput(i, n)) { return false; } //note that the weights are shifted 1 forward in the array so //it leaves the numinputs aligned on the space the weight needs to go. m_weights[m_numInputs] = m_random.nextDouble() * .1 - .05; m_changeInWeights[m_numInputs] = 0; return true; }
return false; if (!t.connectInput(s, s.getNumOutputs() - 1)) {
return false; if (!t.connectInput(s, s.getNumOutputs() - 1)) {