Example #1
0
        public RadialNode AddInput()
        {
            RadialNode node      = this.GetNextAddon();
            RadialNode inputNode = new RadialNode(0d);

            if (node != null)
            {
                node.Addon = inputNode;
                this._nodeLinks.Insert(0, new RadialNodeLink(node.Addon, node, _rand.NextDouble()));
            }
            else
            {
                throw new Exception("Couldn't find free node.");
            }
            return(inputNode);
        }
Example #2
0
        public RadialNode AddOutput()
        {
            RadialNode node       = this.GetNextAddon();
            RadialNode outputNode = new RadialNode(0d);

            if (node != null)
            {
                node.Addon = outputNode;
                this._nodeLinks.Add(new RadialNodeLink(node, node.Addon, 1d));
                this._nodes.Add(outputNode);
            }
            else
            {
                throw new Exception("Couldn't find free node.");
            }
            return(outputNode);
        }
Example #3
0
 public RadialNode(double value)
 {
     this.Value = value;
     this.Addon = null;
 }
Example #4
0
 public RadialNodeLink(RadialNode nodeA, RadialNode nodeB, double weight)
 {
     this.NodeA  = nodeA;
     this.NodeB  = nodeB;
     this.Weight = weight;
 }