def _calc_belief_v(self, i: int) -> Prob:
    p = Prob.same_value(self.model.get_variable(i).domain.size(), (0.0 if self.logdomain else 1.0))
    for ii in self.nbV[i]:
        if self.logdomain:
            p += self._edges[i][ii.iter].new_message
        else:
            p *= self._edges[i][ii.iter].new_message
    return p
def _calc_belief_v(self, i: int) -> Prob:
    p = Prob.same_value(self.model.get_variable(i).domain.size(), (0.0 if self.logdomain else 1.0))
    for ii in self.nbV[i]:
        if self.logdomain:
            p += self._edges[i][ii.iter].new_message
        else:
            p *= self._edges[i][ii.iter].new_message
    return p