public virtual void Fire() { if (thresholdReached) { for (int i = 0; i < numberOfAntsToFire; i++) { IAnt ant = ants[0]; ants.RemoveAt(0); IConnection connection = ChooseConnection(); connection.Neuron.AddAnt(ant); ant.AddConnectionToHistory(connection); ant.Sign *= Sign.GetSign(connection.Weight); } thresholdReached = false; numberOfAntsToFire = 0; } }
public void DistributeReward(double reward) { Weight += Sign.GetSign(Weight) * reward; }