public void CreateBasalSynapses(List <Column> potentialColumns, double zoneCoveragePerc) { zoneCoveragePerc = zoneCoveragePerc < 0 ? 1.0 : zoneCoveragePerc; //create random list of columns to connect int numSynapsesRequired = (int)(potentialColumns.Count * zoneCoveragePerc); int numNewSynapses = numSynapsesRequired - BasalDendrite.Synapses.Count; if (numNewSynapses > 0) //add synapses { //remove columns already connected from the potential list List <Column> alreadyConnected = BasalDendrite.GetConnectedColumnsList(); potentialColumns.RemoveAll(x => alreadyConnected.Contains(x)); IEnumerable <Column> connectColumns = potentialColumns.RandomSample(numNewSynapses, false); foreach (Column col in connectColumns) { BasalDendrite.CreateSynapse(col); } } if (numNewSynapses < 0) //remove synapses { while (BasalDendrite.Synapses.Count > 0 && BasalDendrite.Synapses.Count > numSynapsesRequired) { //remove random synapse BasalDendrite.RemoveSynapseAt(Global.rnd.Next(BasalDendrite.Synapses.Count)); } } }
public void OverridePredicting(bool predicting, int depth) { IsPredicting = predicting; if (depth < Global.OVERRIDE_DEPTH) { BasalDendrite.Override(predicting, depth); } }
//Main function to update all cell states public void Update() { BasalDendrite.Update(); IsPredicting = BasalDendrite.IsActive; }
public void OverrideBasalDendriteActivationThreshold(int threshold) { BasalDendrite.OverrideActivationThreshold(threshold); }
public int CountActiveBasalSynapses() { return(BasalDendrite.CountActiveSynapses()); }
public int CountBasalSynapses() { return(BasalDendrite.CountSynapses()); }