Exemplo n.º 1
0
 public bool AddConnection(int from, int to, double weight)
 {
     if (CNeuroNetWrapperFunctions.__FindConnection(_cnet, from, to) == IntPtr.Zero)
     {
         CNeuroNetWrapperFunctions.__AddConnection(_cnet, from, to, weight);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        public CNeuroNetWrapper(CNeuroNetWrapper copy)
        {
            _numInputs  = copy._numInputs;
            _numOutputs = copy._numOutputs;

            _cnet = CNeuroNetWrapperFunctions.__NewNeuroNet(_numInputs, _numOutputs);

            foreach (var n in copy.Nodes)
            {
                if (n.ID > _numInputs + _numOutputs)
                {
                    CNeuroNetWrapperFunctions.__AddNode(_cnet, n.ID);
                }
            }

            foreach (var c in copy.Connections)
            {
                CNeuroNetWrapperFunctions.__AddConnection(_cnet, c.From, c.To, c.Weight);
            }


            _connections = ConnectionsCollection.GetLinkedCollection(_cnet);
            _nodes       = NodesCollection.GetLinkedConnection(_cnet);
        }
Exemplo n.º 3
0
 public void Add(Connection item)
 {
     CNeuroNetWrapperFunctions.__AddConnection(net, item.From, item.To, item.Weight);
 }