Ejemplo n.º 1
0
 public ConnectionGene(ConnectionGene copy)
 {
     inNode     = copy.GetInNode();
     outNode    = copy.GetOutNode();
     weight     = copy.GetWeight();
     expressed  = copy.IsExpressed();
     innovation = copy.GetInnovation();
 }
 public ConnectionGene(ConnectionGene Connection)
 {
     if (Connection != null)
     {
         this.InputNode  = Connection.GetInputNode();
         this.OutputNode = Connection.GetOutputNode();
         this.Weight     = Connection.GetWeight();
         this.IsEnabled  = Connection.GetEnabled();
         this.Innovation = Connection.GetInnovation();
     }
 }
Ejemplo n.º 3
0
 public override bool Equals(object obj)
 {
     if ((obj == null) || !GetType().Equals(obj.GetType()))
     {
         return(false);
     }
     else
     {
         ConnectionGene con = (ConnectionGene)obj;
         return(innovation == con.GetInnovation());
     }
 }
Ejemplo n.º 4
0
 public void AddConnection(ConnectionGene con)                 //Adds a connection in the genome
 {
     connectionList.Add(con.GetInnovation(), new ConnectionGene(con));
     connectionKeys.Add(con.GetInnovation());
 }