Exemple #1
0
        public float queryCPPNWeight(float x1, float y1, float x2, float y2)
        {
            coordinates[0] = x1;
            coordinates[1] = y1;
            coordinates[2] = x2;
            coordinates[3] = y2;

            genome.ClearSignals();
            genome.SetInputSignals(coordinates);
            genome.RecursiveActivation();

            return(genome.GetOutputSignal(0));
        }
Exemple #2
0
            public float queryCPPN(float x1, float y1, float x2, float y2, out float thrs)
            {
                coordinates[0] = x1;
                coordinates[1] = y1;
                coordinates[2] = x2;
                coordinates[3] = y2;

                genome.ClearSignals();
                genome.SetInputSignals(coordinates);
                genome.RecursiveActivation();
                //genome.MultipleSteps(NETWORK_ITERATIONS);  //TODO query CPPN based on depth

                thrs = 0.0f;

                return(genome.GetOutputSignal(0));  //use weight
            }
Exemple #3
0
        float[] queryCPPNOutputs(ModularNetwork genome, float x1, float y1, float x2, float y2, float maxXDist, float minYDist)
        {
            float[] coordinates = new float[genome.InputNeuronCount];

            coordinates[0] = x1;
            coordinates[1] = y1;
            coordinates[2] = x2;
            coordinates[3] = y2;
            //coordinates[4] = maxXDist;
            //coordinates[5] = minYDist;

            //Console.WriteLine("Coordinates: ({0}, {1} : {2}, {3})", x1, y1, x2, y2);
            genome.ClearSignals();
            genome.SetInputSignals(coordinates);
            genome.RecursiveActivation();

            float[] outs = new float[genome.OutputNeuronCount];
            for (int i = 0; i < genome.OutputNeuronCount; i++)
            {
                outs[i] = genome.GetOutputSignal(i);
            }

            return(outs);
        }