예제 #1
0
파일: NodeGene.cs 프로젝트: polic72/NEAT
        /// <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;
        }
예제 #2
0
파일: NodeGene.cs 프로젝트: polic72/NEAT
 /// <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());
 }
예제 #3
0
파일: NodeGene.cs 프로젝트: polic72/NEAT
 /// <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)
 {
 }
예제 #4
0
파일: NodeGene.cs 프로젝트: polic72/NEAT
 /// <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);
 }