/** * 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) { for (int noa = 0; noa < m_numInputs; noa++) { if (i == m_inputList[noa]) { return false; } } if (m_numInputs >= m_inputList.length) { //then allocate more space to it. allocateInputs(); } m_inputList[m_numInputs] = i; m_inputNums[m_numInputs] = n; m_numInputs++; 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) { for (int noa = 0; noa < m_numInputs; noa++) { if (i == m_inputList[noa]) { return false; } } if (m_numInputs >= m_inputList.length) { //then allocate more space to it. allocateInputs(); } m_inputList[m_numInputs] = i; m_inputNums[m_numInputs] = n; m_numInputs++; return true; }