CreateNetworkDefinition() public method

Create a network definition by querying the provided IBlackBox (typically a CPPN) with the substrate connection endpoints.
public CreateNetworkDefinition ( IBlackBox blackbox, bool lengthCppnInput ) : INetworkDefinition
blackbox IBlackBox The HyperNEAT CPPN that defines the strength of connections between nodes on the substrate.
lengthCppnInput bool Optionally we provide a connection length input to the CPPN.
return INetworkDefinition
示例#1
0
        /// <summary>
        /// Decodes a CPPN NeatGenome to a concrete network instance via a HyperNEAT substrate.
        /// </summary>
        public IBlackBox Decode(NeatGenome genome)
        {
            // Decode the CPPN.
            IBlackBox cppn = _decodeCppnMethod(genome);

            // Generate a network definition from the CPPN and Substrate.
            INetworkDefinition substrateNetworkDef = _substrate.CreateNetworkDefinition(cppn, _lengthCppnInput);

            // Check for null network. This can happen if, e.g. querying the substrate did not result in any connections.
            if (null == substrateNetworkDef)
            {
                return(null);
            }

            // Create a network from the substrate network definition, and return it.
            return(_createSubstrateNetworkMethod(substrateNetworkDef));
        }