public activateNetwork ( double sensors ) : ISignalArray | ||
sensors | double | |
Résultat | ISignalArray |
public virtual ISignalArray activateNetwork(double[] sensors)
{
Brain.ResetState();
// Convert the sensors into an input array for the network
for (int i = 0; i < sensors.Length; i++)
Brain.InputSignalArray[i] = sensors[i];
// Activate the network
Brain.Activate();
return Brain.OutputSignalArray;
}
public double[][] getAgentResponses(double[] reading) { double[][] responses = new double[_world.Agents.Count()][]; for (int i = 0; i < _world.Agents.Count(); i++) { responses[i] = new double[2]; } for (int i = 0; i < _world.Agents.Count(); i++) { NeuralAgent currentAgent = (NeuralAgent)_world.Agents.ElementAt(i); var results = currentAgent.activateNetwork(reading); results.CopyTo(responses[i], 0); } return(responses); }