public void testLimited()
{
MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
ResilientPropagation rprop = new ResilientPropagation(network,trainingData);
rprop.iteration();
rprop.iteration();
network.enableConnection(1, 0, 0, false);
network.enableConnection(1, 1, 0, false);
Assert.assertTrue(network.getStructure().isConnectionLimited());
Assert.assertEquals(0.0, network.getStructure().getFlat().getWeights()[0], 0.01);
Assert.assertEquals(0.0, network.getStructure().getFlat().getWeights()[1], 0.01);
rprop.iteration();
rprop.iteration();
rprop.iteration();
rprop.iteration();
// these connections were removed, and should not have been "trained"
Assert.assertEquals(0.0, network.getStructure().getFlat().getWeights()[0], 0.01);
Assert.assertEquals(0.0, network.getStructure().getFlat().getWeights()[1], 0.01);
rprop.finishTraining();
}