/** * This function will remove all outputs to this unit. * In doing so it will also terminate the connections at the other end. */ public void removeAllOutputs() { for (int noa = 0; noa < m_numOutputs; noa++) { //this command will simply remove any connections this node has //with the other in 1 go, rather than seperately. m_outputList[noa].disconnectInput(this, -1); } //now reset the inputs. m_outputList = new NeuralConnection[0]; m_outputNums = new int[0]; setType(getType() & (~OUTPUT)); if (getNumInputs() == 0) { setType(getType() & (~CONNECTED)); } m_numOutputs = 0; }
/** * This function will remove all outputs to this unit. * In doing so it will also terminate the connections at the other end. */ public void removeAllOutputs() { for (int noa = 0; noa < m_numOutputs; noa++) { //this command will simply remove any connections this node has //with the other in 1 go, rather than seperately. m_outputList[noa].disconnectInput(this, -1); } //now reset the inputs. m_outputList = new NeuralConnection[0]; m_outputNums = new int[0]; setType(getType() & (~OUTPUT)); if (getNumInputs() == 0) { setType(getType() & (~CONNECTED)); } m_numOutputs = 0; }
s.setType(s.getType() & (~OUTPUT)); if (s.getNumInputs() == 0 && s.getNumOutputs() == 0) { s.setType(s.getType() & (~CONNECTED)); if (t.getNumInputs() == 0 && t.getNumOutputs() == 0) { t.setType(t.getType() & (~CONNECTED));
s.setType(s.getType() & (~OUTPUT)); if (s.getNumInputs() == 0 && s.getNumOutputs() == 0) { s.setType(s.getType() & (~CONNECTED)); if (t.getNumInputs() == 0 && t.getNumOutputs() == 0) { t.setType(t.getType() & (~CONNECTED));
return false; //there is no actual working node in use if ((t.getType() & PURE_OUTPUT) == PURE_OUTPUT && t.getNumInputs() > 0) { return false; //more than 1 node is trying to feed a particular output if (!s.connectOutput(t, t.getNumInputs())) { return false; s.disconnectOutput(t, t.getNumInputs()); return false;
return false; //there is no actual working node in use if ((t.getType() & PURE_OUTPUT) == PURE_OUTPUT && t.getNumInputs() > 0) { return false; //more than 1 node is trying to feed a particular output if (!s.connectOutput(t, t.getNumInputs())) { return false; s.disconnectOutput(t, t.getNumInputs()); return false;