diff --git a/factorOperations.py b/factorOperations.py index 1519c87..509ef39 100644 --- a/factorOperations.py +++ b/factorOperations.py @@ -199,6 +199,8 @@ def eliminateWithCallTracking(callTrackingList=None): new_factor = Factor(unconditioned_variables, conditioned_variables, variable_domains_dict) + # we need to reconstruct the probability tables for the new factor + # need to remove the elimination variable, so we should add all probabilities with the same elimination variable. for fill_assignment in new_factor.getAllPossibleAssignmentDicts(): prob = 0 eliminate_variable_domains = factor.variableDomainsDict()[eliminationVariable]