@SuppressWarnings({ "unchecked", "rawtypes" })
public NeuroBrain(AgentType brainsBody, ParCollection params) {
super(brainsBody);
this.pars = params;
neuralNet = new GeneralNeuralNetwork(this.pars);
neuralNet.setStandardActFct(new ActivationFunctionSigmoid(1));
// Bias neuron.
this.neuralNet.addNeuron(new ActivationFunctionConstant(1), Neuron.INPUT_NEURON);
for (GenericSensor<Object, ?, AbstractAgent<?>> sens : this.getMyBody().getSensors()) {
try {
GenericRealValuedSensor<AbstractEnvironment<?>, AbstractAgent<?>> sensor
= (GenericRealValuedSensor) sens;
int id = neuralNet.addNeuron(Neuron.INPUT_NEURON);
sensors.put(id, sensor);
} catch (Exception e) {
}
}
this.neuralNet.addNeuron(new ActivationFunctionSigmoid(0.001), Neuron.HIDDEN_NEURON); // TODO: Delete this line!
for (GenericActuator<?, AbstractAgent<?>> akt : this.getMyBody().getActuators()) {
try {
GenericRealValueDrivenActuator<AbstractEnvironment<?>, AbstractAgent<?>> actuator
= (GenericRealValueDrivenActuator<AbstractEnvironment<?>, AbstractAgent<?>>) akt;