The weight of the edge when Trap combines with TriStop is 1. Added main
Changed marginals[node] to marginals[node].value