Esempio n. 1
0
 public Neuron(string id, bool additive = true)
 {
     _id       = id;
     _additive = additive;
     _host     = null;
     _active   = true;
 }
Esempio n. 2
0
 public Neuron(string id, string formula, NeuronNetwork host = null, bool additive = true)
 {
     _id        = id;
     _additive  = additive;
     _nextValue = _value = 0f;
     _active    = true;
     AddToHost(host);
     AddFormulas(formula);
 }
Esempio n. 3
0
 public Link(string formula, NeuronNetwork host)
 {
     _formula    = formula;
     _parser     = new MathParser();
     _fixedValue = 0.0;
     _random     = new System.Random();
     _active     = true;
     _nw         = host;
     _formula    = formula;
     _parsed     = false;
 }
Esempio n. 4
0
        private void AddToHost(NeuronNetwork host)
        {
            if (_host != null)
            {
                _host.Neurons.Remove(_id);
            }
            _host = host;
            if (_host != null)
            {
                _host.Neurons.Add(_id, this);
            }

//			UnityEngine.Debug.Log("Added neuron "+_id);
        }
        void Start()
        {
            _ai = new NeuronNetwork();

            NeuronLoader nl = gameObject.GetComponent <NeuronLoader>();

            if (nl != null)
            {
                nl.Init();
            }

            for (int i = 0; i < WarmUpIterations; i++)
            {
                _ai.Step(1f);
                if (_debug)
                {
                    DebugPrint(i);
                }
            }
        }
Esempio n. 6
0
 public void Init()
 {
     _network = gameObject.GetComponent <NeuronNetworkHost>().Network;
     Load(Configuration);
 }