C# Class SharpNeat.Decoders.HyperNeat.DefaultNodeSetMappingFunction

Defines a mapping between two node sets based on mapping all source nodes to all target nodes, but with an option to omit mappings where the distance between source and target node is over some threshold. In addition the same nodeset can be passed to the GenerateConnections() method as both source and target. This allows for creating connections between nodes within a layer. The optional max distance still applies and an additional boolean option indicates if the local recurrent connection for each node (from its output back to its input) should be generated.
Inheritance: INodeSetMappingFunction
显示文件 Open project: colgreen/sharpneat

Public Methods

Method Description
DefaultNodeSetMappingFunction ( double maximumConnectionDistance, bool allowLocalRecurrentConnections ) : System

Construct with the specified maximum connection distance (optional/nullable) and flag indicating if local recurrent connections should be generated when generating connections within a single node set (same source and target nodeset).

GenerateConnections ( SubstrateNodeSet srcNodeSet, SubstrateNodeSet tgtNodeSet ) : IEnumerable

Returns an IEnumerable that yields the mappings/connections defined by the mapping function (from the source nodes to the target nodes) as a sequence. The alternative of returning a list would require a very long list in extreme scenarios; this approach minimizes down memory usage.

GetConnectionCountHint ( SubstrateNodeSet srcNodeSet, SubstrateNodeSet tgtNodeSet ) : int

Returns an estimate/hint for the number of connections that would be created between the provided source and target node sets.

Private Methods

Method Description
CalcDistanceSquared ( double srcPos, double tgtPos ) : double

Calculate the Euclidean distance between two points in n-dimensions.

TestNodePair_MaxDistance ( SubstrateNode srcNode, SubstrateNode tgtNode ) : bool
TestNodePair_NullTest ( SubstrateNode srcNode, SubstrateNode tgtNode ) : bool

Method Details

DefaultNodeSetMappingFunction() public method

Construct with the specified maximum connection distance (optional/nullable) and flag indicating if local recurrent connections should be generated when generating connections within a single node set (same source and target nodeset).
public DefaultNodeSetMappingFunction ( double maximumConnectionDistance, bool allowLocalRecurrentConnections ) : System
maximumConnectionDistance double
allowLocalRecurrentConnections bool
return System

GenerateConnections() public method

Returns an IEnumerable that yields the mappings/connections defined by the mapping function (from the source nodes to the target nodes) as a sequence. The alternative of returning a list would require a very long list in extreme scenarios; this approach minimizes down memory usage.
public GenerateConnections ( SubstrateNodeSet srcNodeSet, SubstrateNodeSet tgtNodeSet ) : IEnumerable
srcNodeSet SubstrateNodeSet
tgtNodeSet SubstrateNodeSet
return IEnumerable

GetConnectionCountHint() public method

Returns an estimate/hint for the number of connections that would be created between the provided source and target node sets.
public GetConnectionCountHint ( SubstrateNodeSet srcNodeSet, SubstrateNodeSet tgtNodeSet ) : int
srcNodeSet SubstrateNodeSet
tgtNodeSet SubstrateNodeSet
return int