public void EnableConnection(int fromLayer,
int fromNeuron, int toNeuron, bool enable)
{
double v = GetWeight(fromLayer, fromNeuron, toNeuron);
if (enable)
{
if (!_structure.ConnectionLimited)
{
return;
}
if (Math.Abs(v) < _structure.ConnectionLimit)
{
SetWeight(fromLayer, fromNeuron, toNeuron,
RangeRandomizer.Randomize(-1, 1));
}
}
else
{
if (!_structure.ConnectionLimited)
{
SetProperty(TagLimit,
DefaultConnectionLimit);
_structure.UpdateProperties();
}
SetWeight(fromLayer, fromNeuron, toNeuron, 0);
}
}