small fixes
This commit is contained in:
@@ -52,7 +52,7 @@ cpt_average(AllVars, Key, Els0, Tab, Vs, NewVs) :-
|
||||
cpt_average(AllVars, Key, Els0, 1.0, Tab, Vs, NewVs).
|
||||
|
||||
% support variables with evidence from domain. This should make everyone's life easier.
|
||||
cpt_average([Ev|Vars], Key, Els0, Softness, p(Els0, CPT, NewParents), Vs, NewVs) :-
|
||||
cpt_average([Ev|Vars], Key, Els0, Softness, pf(Els0, MAT, NewParents), Vs, NewVs) :-
|
||||
find_evidence(Vars, 0, TotEvidence, RVars),
|
||||
build_avg_table(RVars, Vars, Els0, Key, TotEvidence, Softness, MAT0, NewParents0, Vs, IVs),
|
||||
include_qevidence(Ev, MAT0, MAT, NewParents0, NewParents, Vs, IVs, NewVs).
|
||||
|
@@ -93,7 +93,7 @@ vars2ids([V|QueryVars], [VarId|Ids]) :-
|
||||
|
||||
get_evidence(V, Ev) :-
|
||||
clpbn:get_atts(V, [evidence(Ev)]), !.
|
||||
get_evidence(V, -1). % no evidence !!!
|
||||
get_evidence(_V, -1). % no evidence !!!
|
||||
|
||||
|
||||
get_extra_vars_info([], []).
|
||||
|
@@ -22,7 +22,7 @@ output_var(Stream, V) :-
|
||||
Parents = [_|_], !,
|
||||
format(Stream, ' ',[]),
|
||||
output_parents(Stream, Parents),
|
||||
format(' -> ',[]),
|
||||
format(Stream,' -> ',[]),
|
||||
output_key(Stream,Key),
|
||||
nl(Stream).
|
||||
output_var(_, _).
|
||||
|
@@ -96,7 +96,7 @@ clpbn_table(F/N,M) :-
|
||||
Key =.. L1,
|
||||
atom_concat(F, '___tabled', NF),
|
||||
L2 = [_|Args],
|
||||
S1 =.. [NF|Args],
|
||||
_S1 =.. [NF|Args],
|
||||
L0 = [_|OArgs],
|
||||
S2 =.. [NF|OArgs],
|
||||
asserta(clpbn_table(S, M, S2)),
|
||||
|
@@ -97,7 +97,8 @@ run_vel_solver(LVs, LPs, LNVs) :-
|
||||
findall(Ps, solve_vel(LVs, LNVs, Ps), LPs).
|
||||
|
||||
solve_vel([LVs|_], [NVs0|_], Ps) :-
|
||||
% length(NVs0, L), (L > 64 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ),
|
||||
% length(NVs0, L), (L > 415 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ),
|
||||
% length(NVs0, L), writeln(+LVs:L),
|
||||
find_all_clpbn_vars(NVs0, NVs0, LV0, LVi, Tables0),
|
||||
sort(LV0, LV),
|
||||
% construct the graph
|
||||
|
Reference in New Issue
Block a user