Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a node gene with the given node gene pattern and activation function.
        /// </summary>
        /// <param name="nodeGenePattern">The node gene pattern that this node gene implements.</param>
        /// <param name="activationFunction">The activation function of the node.</param>
        /// <exception cref="ArgumentNullException">When the node gene pattern or activation function is null.</exception>
        protected internal NodeGene(NodeGenePattern nodeGenePattern, Node.ActivationFunction activationFunction)
        {
            Helpers.ThrowOnNull(nodeGenePattern, "nodeGenePattern");
            Helpers.ThrowOnNull(activationFunction, "activationFunction");


            NodeGenePattern = nodeGenePattern;

            ActivationFunction = activationFunction;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the hash code of this node gene. Is the ConnectionGenePattern hash code as well.
 /// </summary>
 /// <returns>The hash code.</returns>
 public override int GetHashCode()
 {
     return(NodeGenePattern.GetHashCode());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a node gene with the given node gene pattern and default activation function (<see cref="NEAT.Neural_Network.Node.Sigmoid(double)"/>).
 /// </summary>
 /// <param name="nodeGenePattern">The node gene pattern that this node gene implements.</param>
 /// <exception cref="ArgumentNullException">When the node gene pattern is null.</exception>
 protected internal NodeGene(NodeGenePattern nodeGenePattern)
     : this(nodeGenePattern, Node.Sigmoid)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// String representation of this node gene.
 /// </summary>
 /// <returns>String representation of this node gene.</returns>
 public override string ToString()
 {
     return(NodeGenePattern.ToString() + ", ActFunc: " + ActivationFunction.Method.Name);
 }