//public readonly bool showLabel; public NodeEditorField(NodePlace nodePlace = NodePlace.MainContainer, string label = "", bool hideLabel = false, string portContainer = "", float minWidth = -1, bool editable = true) { this.nodePlace = nodePlace; this.label = label; this.hideLabel = hideLabel; this.portContainer = portContainer; this.minWidth = minWidth; this.editable = editable; }
/** Reset the node to initial status. */ public void Reset(NodeType nodeType, int id, NodePlace placement) { // NNode::NNode(nodetype ntype,int nodeid, nodeplace placement) NodeId = id; ActiveFlag = false; ActiveSum = 0; Activation = 0; LastActivation = 0; PreviousLastActivation = 0; Type = nodeType; // NEURON or SENSOR type ActivationCount = 0; // Inactive upon creation functionType = FunctionType.SIGMOID; GeneticNodeLabel = placement; Frozen = false; Override = false; OverrideValue = 0; InnerLevel = 0; IsTraversed = false; }
public void Setup(IEvolutionState state, IParameter paramBase) { ActivationCount = 0; LastActivation = 0; PreviousLastActivation = 0; Override = false; OverrideValue = 0; Frozen = false; // TODO : could be extend to use some other activation function functionType = FunctionType.SIGMOID; Type = NodeType.NEURON; GeneticNodeLabel = NodePlace.HIDDEN; ActiveSum = 0; Activation = 0; ActiveFlag = false; IncomingGenes = new List <NEATGene>(); NodeId = 0; InnerLevel = 0; IsTraversed = false; }
/** * This method is used to read a node in start genome from file. */ public void ReadNodeFromString(string str, IEvolutionState state) { DecodeReturn dr = new DecodeReturn(str); Code.Decode(dr); NodeId = (int)dr.L; Code.Decode(dr); int nType = (int)dr.L; Code.Decode(dr); int nPlace = (int)dr.L; var vals = Enum.GetValues(typeof(NodeType)); Type = (NodeType)vals.GetValue(nType); GeneticNodeLabel = (NodePlace)Enum.GetValues(typeof(NodePlace)).GetValue(nPlace); Override = false; ActiveSum = 0; Frozen = false; }