Example #1
0
 public CNeuroNetWrapper(int numInputs, int numOutputs)
 {
     _cnet        = CNeuroNetWrapperFunctions.__NewNeuroNet(numInputs, numOutputs);
     _numInputs   = numInputs;
     _numOutputs  = numOutputs;
     _connections = ConnectionsCollection.GetLinkedCollection(_cnet);
     _nodes       = NodesCollection.GetLinkedConnection(_cnet);
 }
Example #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);
        }