Esempio 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;
        }
Esempio 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());
 }
Esempio 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)
 {
 }
Esempio 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);
 }