public void testAverageThreeCollectedNetworks() throws Exception {
NeuralNetworkUtil util = new NeuralNetworkUtil();
NeuralNetwork nn0 = buildXORMLP();
nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0));
nn0.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(1));
/*
nn0.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(0).setWeight(new Weight(2));
nn0.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(1).setWeight(new Weight(3));
nn0.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(0).setWeight(new Weight(4));
nn0.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(1).setWeight(new Weight(5));
// output layer
nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0.1));
nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0.2));
nn0.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(2).setWeight(new Weight(0.3));
*/
util.AccumulateWorkerNetwork( nn0 );
NeuralNetwork nn1 = buildXORMLP();
nn1.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(1));
nn1.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0));
/*
nn1.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(0).setWeight(new Weight(4));
nn1.getLayerByIndex(1).getNeuronAt(1).getInConnections().get(1).setWeight(new Weight(5));
nn1.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(0).setWeight(new Weight(6));
nn1.getLayerByIndex(1).getNeuronAt(2).getInConnections().get(1).setWeight(new Weight(7));
// output layer
nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(0.4));
nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(0.6));
nn1.getLayerByIndex(2).getNeuronAt(0).getInConnections().get(2).setWeight(new Weight(0.8));
*/
util.AccumulateWorkerNetwork( nn1 );
NeuralNetwork nn2 = buildXORMLP();
nn2.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(0).setWeight(new Weight(2));
nn2.getLayerByIndex(1).getNeuronAt(0).getInConnections().get(1).setWeight(new Weight(5));
util.AccumulateWorkerNetwork( nn2 );
//NeuralNetwork nn_out = util.AverageNetworkWeights();
NetworkAccumulator accumNet = NetworkAccumulator.buildAveragingNetworkFromConf(nn0.getConfig());