Example #1
0
    void Setup()
    {
        Connection input1_hidden1 = new Connection ();
        Connection input1_hidden2 = new Connection ();
        Connection input1_hidden3 = new Connection ();
        Connection input1_hidden4 = new Connection ();
        Connection input1_hidden5 = new Connection ();

        Connection input2_hidden1 = new Connection ();
        Connection input2_hidden2 = new Connection ();
        Connection input2_hidden3 = new Connection ();
        Connection input2_hidden4 = new Connection ();
        Connection input2_hidden5 = new Connection ();

        Connection input3_hidden1 = new Connection ();
        Connection input3_hidden2 = new Connection ();
        Connection input3_hidden3 = new Connection ();
        Connection input3_hidden4 = new Connection ();
        Connection input3_hidden5 = new Connection ();

        Connection hidden1_output1 = new Connection ();
        Connection hidden2_output1 = new Connection ();
        Connection hidden3_output1 = new Connection ();
        Connection hidden4_output1 = new Connection ();
        Connection hidden5_output1 = new Connection ();

        Connection hidden1_output2 = new Connection ();
        Connection hidden2_output2 = new Connection ();
        Connection hidden3_output2 = new Connection ();
        Connection hidden4_output2 = new Connection ();
        Connection hidden5_output2 = new Connection ();

        Connection bias1_input1 = new Connection ();
        Connection bias2_input2 = new Connection ();
        Connection bias3_input3 = new Connection ();

        Neuron input1 = new Neuron ();
        Neuron bias1 = new Neuron ();

        Neuron input2 = new Neuron ();
        Neuron bias2 = new Neuron ();

        Neuron input3 = new Neuron ();
        Neuron bias3 = new Neuron ();

        Neuron hidden1 = new Neuron ();
        Neuron hidden2 = new Neuron ();
        Neuron hidden3 = new Neuron ();
        Neuron hidden4 = new Neuron ();
        Neuron hidden5 = new Neuron ();

        Neuron output1 = new Neuron ();
        Neuron output2 = new Neuron ();

        input1_hidden1.SetConnections (input1, hidden1);
        input1_hidden2.SetConnections (input1, hidden2);
        input1_hidden3.SetConnections (input1, hidden3);
        input1_hidden4.SetConnections (input1, hidden4);
        input1_hidden5.SetConnections (input1, hidden5);

        input2_hidden1.SetConnections (input2, hidden1);
        input2_hidden2.SetConnections (input2, hidden2);
        input2_hidden3.SetConnections (input2, hidden3);
        input2_hidden4.SetConnections (input2, hidden4);
        input2_hidden5.SetConnections (input2, hidden5);

        input3_hidden1.SetConnections (input3, hidden1);
        input3_hidden2.SetConnections (input3, hidden2);
        input3_hidden3.SetConnections (input3, hidden3);
        input3_hidden4.SetConnections (input3, hidden4);
        input3_hidden5.SetConnections (input3, hidden5);

        hidden1_output1.SetConnections (hidden1, output1);
        hidden2_output1.SetConnections (hidden2, output1);
        hidden3_output1.SetConnections (hidden3, output1);
        hidden4_output1.SetConnections (hidden4, output1);
        hidden5_output1.SetConnections (hidden5, output1);

        hidden1_output2.SetConnections (hidden1, output2);
        hidden2_output2.SetConnections (hidden2, output2);
        hidden3_output2.SetConnections (hidden3, output2);
        hidden4_output2.SetConnections (hidden4, output2);
        hidden5_output2.SetConnections (hidden5, output2);

        bias1_input1.SetConnections (bias1, input1);
        bias2_input2.SetConnections (bias2, input2);
        bias3_input3.SetConnections (bias3, input3);

        bias1.SetPlace (NeuronPlace.bias);
        bias1.AddOutputConnection (bias1_input1);

        bias2.SetPlace (NeuronPlace.bias);
        bias2.AddOutputConnection (bias2_input2);

        bias3.SetPlace (NeuronPlace.bias);
        bias3.AddOutputConnection (bias3_input3);

        input1.SetPlace (NeuronPlace.input);
        input1.AddOutputConnection (input1_hidden1);
        input1.AddOutputConnection (input1_hidden2);
        input1.AddOutputConnection (input1_hidden3);
        input1.AddOutputConnection (input1_hidden4);
        input1.AddOutputConnection (input1_hidden5);

        input2.SetPlace (NeuronPlace.input);
        input2.AddOutputConnection (input2_hidden1);
        input2.AddOutputConnection (input2_hidden2);
        input2.AddOutputConnection (input2_hidden3);
        input2.AddOutputConnection (input2_hidden4);
        input2.AddOutputConnection (input2_hidden5);

        input3.SetPlace (NeuronPlace.input);
        input3.AddOutputConnection (input3_hidden1);
        input3.AddOutputConnection (input3_hidden2);
        input3.AddOutputConnection (input3_hidden3);
        input3.AddOutputConnection (input3_hidden4);
        input3.AddOutputConnection (input3_hidden5);

        hidden1.SetPlace (NeuronPlace.hidden);
        hidden1.AddInputConnection (input1_hidden1);
        hidden1.AddInputConnection (input2_hidden1);
        hidden1.AddInputConnection (input3_hidden1);
        hidden1.AddOutputConnection (hidden1_output1);
        hidden1.AddOutputConnection (hidden1_output2);

        hidden2.SetPlace (NeuronPlace.hidden);
        hidden2.AddInputConnection (input1_hidden2);
        hidden2.AddInputConnection (input2_hidden2);
        hidden2.AddInputConnection (input3_hidden2);
        hidden2.AddOutputConnection (hidden2_output1);
        hidden2.AddOutputConnection (hidden2_output2);

        hidden3.SetPlace (NeuronPlace.hidden);
        hidden3.AddInputConnection (input1_hidden3);
        hidden3.AddInputConnection (input2_hidden3);
        hidden2.AddInputConnection (input3_hidden3);
        hidden3.AddOutputConnection (hidden3_output1);
        hidden3.AddOutputConnection (hidden3_output2);

        hidden4.SetPlace (NeuronPlace.hidden);
        hidden4.AddInputConnection (input1_hidden4);
        hidden4.AddInputConnection (input2_hidden4);
        hidden4.AddInputConnection (input3_hidden4);
        hidden4.AddOutputConnection (hidden4_output1);
        hidden4.AddOutputConnection (hidden4_output2);

        hidden5.SetPlace (NeuronPlace.hidden);
        hidden5.AddInputConnection (input1_hidden5);
        hidden5.AddInputConnection (input2_hidden5);
        hidden5.AddInputConnection (input3_hidden5);
        hidden5.AddOutputConnection (hidden5_output1);
        hidden5.AddOutputConnection (hidden5_output2);

        output1.SetPlace (NeuronPlace.output);
        output1.AddInputConnection (hidden1_output1);
        output1.AddInputConnection (hidden2_output1);
        output1.AddInputConnection (hidden3_output1);
        output1.AddInputConnection (hidden4_output1);
        output1.AddInputConnection (hidden5_output1);

        output2.SetPlace (NeuronPlace.output);
        output2.AddInputConnection (hidden1_output2);
        output2.AddInputConnection (hidden2_output2);
        output2.AddInputConnection (hidden3_output2);
        output2.AddInputConnection (hidden4_output2);
        output2.AddInputConnection (hidden5_output2);

        connections.Add (input1_hidden1);
        connections.Add (input1_hidden2);
        connections.Add (input1_hidden3);
        connections.Add (input1_hidden4);
        connections.Add (input1_hidden5);

        connections.Add (input2_hidden1);
        connections.Add (input2_hidden2);
        connections.Add (input2_hidden3);
        connections.Add (input2_hidden4);
        connections.Add (input2_hidden5);

        connections.Add (input3_hidden1);
        connections.Add (input3_hidden2);
        connections.Add (input3_hidden3);
        connections.Add (input3_hidden4);
        connections.Add (input3_hidden5);

        connections.Add (bias1_input1);
        connections.Add (bias2_input2);
        connections.Add (bias3_input3);

        connections.Add (hidden1_output1);
        connections.Add (hidden2_output1);
        connections.Add (hidden3_output1);
        connections.Add (hidden4_output1);
        connections.Add (hidden5_output1);

        connections.Add (hidden1_output2);
        connections.Add (hidden2_output2);
        connections.Add (hidden3_output2);
        connections.Add (hidden4_output2);
        connections.Add (hidden5_output2);

        neurons.Add (input1);
        neurons.Add (bias1);

        neurons.Add (input2);
        neurons.Add (bias2);

        neurons.Add (input3);
        neurons.Add (bias3);

        neurons.Add (hidden1);
        neurons.Add (hidden2);
        neurons.Add (hidden3);
        neurons.Add (hidden4);
        neurons.Add (hidden5);

        neurons.Add (output1);
        neurons.Add (output2);

        canRun = true;
    }