neuron = $neuron; $this->sigma = $sigma; } /** * @return Neuron */ public function getNeuron() { return $this->neuron; } /** * @return float */ public function getSigma() { return $this->sigma; } /** * @param Neuron $neuron * * @return float */ public function getSigmaForNeuron(Neuron $neuron): float { $sigma = 0.0; foreach ($this->neuron->getSynapses() as $synapse) { if ($synapse->getNode() == $neuron) { $sigma += $synapse->getWeight() * $this->getSigma(); } } return $sigma; } }