public override bool Equals(object obj) { if ((obj == null) || !this.GetType().Equals(obj.GetType())) { return(false); } else { NodeGene node = (NodeGene)obj; return(id == node.GetId()); } }
public List <ConnectionGene> FindNodeConnections(NodeGene node) { List <ConnectionGene> nodeConnections = new List <ConnectionGene>(); //Debug.Log("search"+node); for (int i = 0; i < connections.Count; i++) { //Debug.Log(connections[i].GetOutNode()); //Debug.Log(i+" "+node.GetId() +" "+ connections[i].GetOutNode().GetId()); if (node.GetId() == connections[i].GetOutNode().GetId()) { //Debug.Log("found "+i + " " + node.GetId() + " " + connections[i].GetOutNode().GetId()); nodeConnections.Add(connections[i]); } } //Debug.Log(nodeConnections.Count); return(nodeConnections); }
public override string ToString() { return("innovation: " + innovation + " Nodes: " + inNode.GetId() + " -> " + outNode.GetId() + " weight: " + weight + " expressed: " + expressed + " Layer: " + inNode.GetLayer() + "- > " + outNode.GetLayer() + " nodeIn: " + inNode + " Nodeout: " + outNode); }