C# 클래스 SharpNeat.Network.NetworkXmlIO

Static class for reading and writing Network Definitions(s) to and from XML.
파일 보기 프로젝트 열기: colgreen/sharpneat

공개 메소드들

메소드 설명
GetActivationFunction ( string name ) : IActivationFunction

Gets an IActivationFunction from its short name.

GetNodeType ( string type ) : NodeType

Gets the NodeType for the specified node type string. Note. we use our own type strings in place of Enum.ToString() to provide more compact XML.

GetNodeTypeString ( NodeType nodeType ) : string

Gets the node type string for the specified NodeType. Note. we use our own type strings in place of Enum.ToString() to provide more compact XML.

LoadCompleteGenomeList ( XmlNode xmlNode, bool nodeFnIds ) : List

Reads a list of NetworkDefinition(s) from XML that has a containing 'Root' element. The root element also contains the activation function library that the network definitions are associated with.

ReadActivationFunctionLibrary ( XmlReader xr ) : IActivationFunctionLibrary

Reads an IActivationFunctionLibrary from the provided XmlReader.

ReadAttributeAsNodeType ( XmlReader xr, string attrName ) : NodeType

Read the named attribute and parse its string value as a NodeType.

ReadCompleteNetworkDefinitionList ( XmlReader xr, bool nodeFnIds ) : List

Reads a list of NetworkDefinition(s) from XML that has a containing 'Root' element. The root element also contains the activation function library that the genomes are associated with.

ReadGenome ( XmlNode xmlNode, IActivationFunctionLibrary activationFnLib, bool nodeFnIds ) : NetworkDefinition

Reads a NetworkDefinition from XML.

ReadNetworkDefinition ( XmlReader xr, IActivationFunctionLibrary activationFnLib, bool nodeFnIds ) : NetworkDefinition

Reads a network definition from XML. An activation function library is required to decode the function ID at each node, typically the library is stored alongside the network definition XML and will have already been read elsewhere and passed in here.

Save ( NetworkDefinition networkDef, bool nodeFnIds ) : XmlDocument

Writes a single NetworkDefinition to XML. The XML is returned as a newly created XmlDocument.

SaveComplete ( IList networkDefList, bool nodeFnIds ) : XmlDocument

Writes a list of NetworkDefinition(s) to XML within a containing 'Root' element and the activation function library that the genomes are associated with. The XML is returned as a newly created XmlDocument.

SaveComplete ( NetworkDefinition networkDef, bool nodeFnIds ) : XmlDocument

Writes a single NetworkDefinition to XML within a containing 'Root' element and the activation function library that the genome is associated with. The XML is returned as a newly created XmlDocument.

Write ( XmlWriter xw, IActivationFunctionLibrary activationFnLib ) : void

Writes an activation function library to XML. This links activation function names to the integer IDs used by network nodes, which allows us emit just the ID for each node thus resulting in XML that is more compact compared to emitting the activation function name for each node.

Write ( XmlWriter xw, INetworkDefinition networkDef, bool nodeFnIds ) : void

Writes an INetworkDefinition to XML.

WriteComplete ( XmlWriter xw, IList networkDefList, bool nodeFnIds ) : void

Writes a list of INetworkDefinition(s) to XML within a containing 'Root' element and the activation function library that the genomes are associated with.

WriteComplete ( XmlWriter xw, IList networkDefList, bool nodeFnIds ) : void

Writes a list of INetworkDefinition(s) to XML within a containing 'Root' element and the activation function library that the genomes are associated with.

WriteComplete ( XmlWriter xw, INetworkDefinition networkDef, bool nodeFnIds ) : void

Writes a single INetworkDefinition to XML within a containing 'Root' element and the activation function library that the genome is associated with.

비공개 메소드들

메소드 설명
NormalizeSelectionProbabilities ( IList fnList ) : void

Normalize the selection probabilities of the provided ActivationFunctionInfo items.

메소드 상세

GetActivationFunction() 공개 정적인 메소드

Gets an IActivationFunction from its short name.
public static GetActivationFunction ( string name ) : IActivationFunction
name string
리턴 IActivationFunction

GetNodeType() 공개 정적인 메소드

Gets the NodeType for the specified node type string. Note. we use our own type strings in place of Enum.ToString() to provide more compact XML.
public static GetNodeType ( string type ) : NodeType
type string
리턴 NodeType

GetNodeTypeString() 공개 정적인 메소드

Gets the node type string for the specified NodeType. Note. we use our own type strings in place of Enum.ToString() to provide more compact XML.
public static GetNodeTypeString ( NodeType nodeType ) : string
nodeType NodeType
리턴 string

LoadCompleteGenomeList() 공개 정적인 메소드

Reads a list of NetworkDefinition(s) from XML that has a containing 'Root' element. The root element also contains the activation function library that the network definitions are associated with.
public static LoadCompleteGenomeList ( XmlNode xmlNode, bool nodeFnIds ) : List
xmlNode System.Xml.XmlNode The XmlNode to read from. This can be an XmlDocument or XmlElement.
nodeFnIds bool Indicates if node activation function IDs should be read. If false then /// all node activation function IDs default to 0.
리턴 List

ReadActivationFunctionLibrary() 공개 정적인 메소드

Reads an IActivationFunctionLibrary from the provided XmlReader.
public static ReadActivationFunctionLibrary ( XmlReader xr ) : IActivationFunctionLibrary
xr XmlReader
리턴 IActivationFunctionLibrary

ReadAttributeAsNodeType() 공개 정적인 메소드

Read the named attribute and parse its string value as a NodeType.
public static ReadAttributeAsNodeType ( XmlReader xr, string attrName ) : NodeType
xr XmlReader
attrName string
리턴 NodeType

ReadCompleteNetworkDefinitionList() 공개 정적인 메소드

Reads a list of NetworkDefinition(s) from XML that has a containing 'Root' element. The root element also contains the activation function library that the genomes are associated with.
public static ReadCompleteNetworkDefinitionList ( XmlReader xr, bool nodeFnIds ) : List
xr XmlReader The XmlReader to read from.
nodeFnIds bool Indicates if node activation function IDs should be read. They are required /// for HyperNEAT genomes but not NEAT
리턴 List

ReadGenome() 공개 정적인 메소드

Reads a NetworkDefinition from XML.
public static ReadGenome ( XmlNode xmlNode, IActivationFunctionLibrary activationFnLib, bool nodeFnIds ) : NetworkDefinition
xmlNode System.Xml.XmlNode The XmlNode to read from. This can be an XmlDocument or XmlElement.
activationFnLib IActivationFunctionLibrary The activation function library used to decode node activation function IDs.
nodeFnIds bool Indicates if node activation function IDs should be read. They are required /// for HyperNEAT genomes but not for NEAT. If false then all node activation function IDs default to 0.
리턴 NetworkDefinition

ReadNetworkDefinition() 공개 정적인 메소드

Reads a network definition from XML. An activation function library is required to decode the function ID at each node, typically the library is stored alongside the network definition XML and will have already been read elsewhere and passed in here.
public static ReadNetworkDefinition ( XmlReader xr, IActivationFunctionLibrary activationFnLib, bool nodeFnIds ) : NetworkDefinition
xr XmlReader The XmlReader to read from.
activationFnLib IActivationFunctionLibrary The activation function library used to decode node activation function IDs.
nodeFnIds bool Indicates if node activation function IDs should be read. They are required /// for HyperNEAT genomes but not NEAT
리턴 NetworkDefinition

Save() 공개 정적인 메소드

Writes a single NetworkDefinition to XML. The XML is returned as a newly created XmlDocument.
public static Save ( NetworkDefinition networkDef, bool nodeFnIds ) : XmlDocument
networkDef NetworkDefinition The genome to save.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 System.Xml.XmlDocument

SaveComplete() 공개 정적인 메소드

Writes a list of NetworkDefinition(s) to XML within a containing 'Root' element and the activation function library that the genomes are associated with. The XML is returned as a newly created XmlDocument.
public static SaveComplete ( IList networkDefList, bool nodeFnIds ) : XmlDocument
networkDefList IList List of genomes to write as XML.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 System.Xml.XmlDocument

SaveComplete() 공개 정적인 메소드

Writes a single NetworkDefinition to XML within a containing 'Root' element and the activation function library that the genome is associated with. The XML is returned as a newly created XmlDocument.
public static SaveComplete ( NetworkDefinition networkDef, bool nodeFnIds ) : XmlDocument
networkDef NetworkDefinition The NetworkDefinition to save.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 System.Xml.XmlDocument

Write() 공개 정적인 메소드

Writes an activation function library to XML. This links activation function names to the integer IDs used by network nodes, which allows us emit just the ID for each node thus resulting in XML that is more compact compared to emitting the activation function name for each node.
public static Write ( XmlWriter xw, IActivationFunctionLibrary activationFnLib ) : void
xw System.Xml.XmlWriter
activationFnLib IActivationFunctionLibrary
리턴 void

Write() 공개 정적인 메소드

Writes an INetworkDefinition to XML.
public static Write ( XmlWriter xw, INetworkDefinition networkDef, bool nodeFnIds ) : void
xw System.Xml.XmlWriter XmlWriter to write XML to.
networkDef INetworkDefinition Network definition to write as XML.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 void

WriteComplete() 공개 정적인 메소드

Writes a list of INetworkDefinition(s) to XML within a containing 'Root' element and the activation function library that the genomes are associated with.
public static WriteComplete ( XmlWriter xw, IList networkDefList, bool nodeFnIds ) : void
xw System.Xml.XmlWriter XmlWriter to write XML to.
networkDefList IList List of network definitions to write as XML.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 void

WriteComplete() 공개 정적인 메소드

Writes a list of INetworkDefinition(s) to XML within a containing 'Root' element and the activation function library that the genomes are associated with.
public static WriteComplete ( XmlWriter xw, IList networkDefList, bool nodeFnIds ) : void
xw System.Xml.XmlWriter XmlWriter to write XML to.
networkDefList IList List of network definitions to write as XML.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 void

WriteComplete() 공개 정적인 메소드

Writes a single INetworkDefinition to XML within a containing 'Root' element and the activation function library that the genome is associated with.
public static WriteComplete ( XmlWriter xw, INetworkDefinition networkDef, bool nodeFnIds ) : void
xw System.Xml.XmlWriter XmlWriter to write XML to.
networkDef INetworkDefinition Network definition to write as XML.
nodeFnIds bool Indicates if node activation function IDs should be emitted. They are required /// for HyperNEAT genomes but not for NEAT.
리턴 void