public void passMessage ( JunctionTreeClique sourceClique , JunctionTreeSeparator sep , JunctionTreeClique targetClique ) { double [ ] sepPots = separatorStates [ sep . getId ( ) ] . getPotentials ( ) ; double [ ] oldSepPots = Arrays . copyOf ( sepPots , sepPots . length ) ; BayesVariable [ ] sepVars = sep . getValues ( ) . toArray ( new BayesVariable [ sep . getValues ( ) . size ( ) ] ) ; if ( passMessageListener != null ) { passMessageListener . beforeProjectAndAbsorb ( sourceClique , sep , targetClique , oldSepPots ) ; } project ( sepVars , cliqueStates [ sourceClique . getId ( ) ] , separatorStates [ sep . getId ( ) ] ) ; if ( passMessageListener != null ) { passMessageListener . afterProject ( sourceClique , sep , targetClique , oldSepPots ) ; } absorb ( sepVars , cliqueStates [ targetClique . getId ( ) ] , separatorStates [ sep . getId ( ) ] , oldSepPots ) ; if ( passMessageListener != null ) { passMessageListener . afterAbsorb ( sourceClique , sep , targetClique , oldSepPots ) ; } }
Passes a message from node1 to node2 . node1 projects its trgPotentials into the separator . node2 then absorbs those trgPotentials from the separator .