Ejemplo n.º 1
0
// Find a nodeId suitable for use as an inbound node for a newly created
// neuron.  This can either be a sensor node or another neuron node (including
// the new neuron itself), but it cannot be an actuator node.
func findRecurrentInboundNodeId(cortex *ng.Cortex, layerMap ng.LayerToNodeIdMap, fromLayer float64) *ng.NodeId {

	keys := layerMap.Keys()
	actuatorLayer := keys[len(keys)-1]
	chosenNodeId := layerMap.ChooseNodeIdPrecedingLayer(actuatorLayer)
	return chosenNodeId

}