just link if variables have evidence, we can discard other unused variables.

This commit is contained in:
Vitor Santos Costa 2011-05-21 00:19:53 +01:00
parent adcc2797e1
commit 27dbe24b9e

View File

@ -156,7 +156,6 @@ clpbn_flag(parameter_softening,Before,After) :-
{Var = Key with Dist} :-
put_atts(El,[key(Key),dist(DistInfo,Parents)]),
dist(Dist, DistInfo, Key, Parents),
store_var(El),
add_evidence(Var,Key,DistInfo,El)
% ,writeln({Var = Key with Dist})
.
@ -193,8 +192,10 @@ add_evidence(V,Key,Distinfo,NV) :-
nonvar(V), !,
get_evidence_position(V, Distinfo, Pos),
check_stored_evidence(Key, Pos),
store_var(NV),
clpbn:put_atts(NV,evidence(Pos)).
add_evidence(V,K,_,V) :-
store_var(V),
add_evidence(K,V).
clpbn_marginalise(V, Dist) :-