C# 클래스 SharpNeat.Genomes.Neat.ConnectionGeneListBuilder

Used for building a list of connection genes. Connection genes are added one by one to a list and a dictionary of added connection genes is maintained keyed on ConnectionEndpointsStruct to allow a caller to check if a connection with the same end points (and potentially a different innovation ID) already exists in the list.
파일 보기 프로젝트 열기: colgreen/sharpneat

공개 메소드들

메소드 설명
ConnectionGeneListBuilder ( int connectionCapacity ) : System.Collections.Generic

Constructs the builder with the provided capacity. The capacity should be chosen to limit the number of memory re-allocations that occur within the contained connection list dictionary.

IsConnectionCyclic ( uint srcNeuronId, uint tgtNeuronId ) : bool

Tests if adding the specified connection would cause a cyclic pathway in the network connectivity. Returns true if the connection would form a cycle. Note. This same logic is implemented on NeatGenome.IsConnectionCyclic() but against slightly different data structures, hence the method is re-implemented here.

TryAddGene ( ConnectionGene connectionGene, NeatGenome parentGenome, bool overwriteExisting ) : void

Add a ConnectionGene to the builder, but only if the connection is not already present (as determined by it's neuron ID endpoints).

메소드 상세

ConnectionGeneListBuilder() 공개 메소드

Constructs the builder with the provided capacity. The capacity should be chosen to limit the number of memory re-allocations that occur within the contained connection list dictionary.
public ConnectionGeneListBuilder ( int connectionCapacity ) : System.Collections.Generic
connectionCapacity int
리턴 System.Collections.Generic

IsConnectionCyclic() 공개 메소드

Tests if adding the specified connection would cause a cyclic pathway in the network connectivity. Returns true if the connection would form a cycle. Note. This same logic is implemented on NeatGenome.IsConnectionCyclic() but against slightly different data structures, hence the method is re-implemented here.
public IsConnectionCyclic ( uint srcNeuronId, uint tgtNeuronId ) : bool
srcNeuronId uint
tgtNeuronId uint
리턴 bool

TryAddGene() 공개 메소드

Add a ConnectionGene to the builder, but only if the connection is not already present (as determined by it's neuron ID endpoints).
public TryAddGene ( ConnectionGene connectionGene, NeatGenome parentGenome, bool overwriteExisting ) : void
connectionGene ConnectionGene The connection to add.
parentGenome NeatGenome The connection's parent genome. This is used to obtain NeuronGene(s) for the connection endpoints.
overwriteExisting bool A flag that indicates if this connection should take precedence over an existing connection with /// the same endpoints.
리턴 void