fix warning messages.

This commit is contained in:
Vitor Santos Costa 2011-07-04 22:36:34 +01:00
parent 89e23bff65
commit 9727f3c71c
4 changed files with 12 additions and 9 deletions

View File

@ -58,8 +58,8 @@ init_bp_solver(_, AllVars, _, (BayesNet, DistIds)) :-
sort(DistIds0, DistIds),
%(num_bayes_nets(0) -> writeln(vars:VarsInfo) ; true),
%(num_bayes_nets(0) -> writeln(dists:DistsInfo) ; true),
create_network(VarsInfo, BayesNet).
%get_extra_vars_info(AllVars, ExtraVarsInfo),
create_network(VarsInfo, BayesNet),
get_extra_vars_info(AllVars, ExtraVarsInfo).
%set_extra_vars_info(BayesNet, ExtraVarsInfo).
@ -99,10 +99,15 @@ get_evidence(_V, -1). % no evidence !!!
get_extra_vars_info([], []).
get_extra_vars_info([V|Vs], [v(VarId, Label, Domain)|VarsInfo]) :-
get_atts(V, [id(VarId)]), !,
writeln(k:V),
clpbn:get_atts(V, [key(Key),dist(DistId, _)]),
writeln(j:Key),
term_to_atom(Key, Label),
writeln(i:Label),
get_dist_domain(DistId, Domain0),
writeln(a:Domain0),
numbers2atoms(Domain0, Domain),
writeln(b:Domain),
get_extra_vars_info(Vs, VarsInfo).
get_extra_vars_info([_|Vs], VarsInfo) :-
get_extra_vars_info(Vs, VarsInfo).

View File

@ -43,8 +43,7 @@ build_edges([P|Parents], V, [P-V|Edges]) :-
influences(Vs, G, RG, Vars) :-
rb_new(Visited0),
influences(Vs, G, RG, Visited0, Visited),
all_top(Visited, Vars),
length(Vars,Leng), writeln(done:Leng).
all_top(Visited, Vars).
influences([], _, _, Visited, Visited).
influences([V|LV], G, RG, Vs, NVs) :-

View File

@ -97,8 +97,8 @@ run_ve_solver(LVs, LPs, LNVs) :-
findall(Ps, solve_ve(LVs, LNVs, Ps), LPs).
solve_ve([LVs|_], [NVs0|_], Ps) :-
% length(NVs0, L), (L > 415 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ),
% length(NVs0, L), writeln(+LVs:L),
% length(NVs0, L), (L > 10 -> clpbn_gviz:clpbn2gviz(user_error,sort,NVs0,LVs) ; true ),
% length(NVs0, L), writeln(+L),
find_all_clpbn_vars(NVs0, NVs0, LV0, LVi, Tables0),
sort(LV0, LV),
% construct the graph

View File

@ -123,14 +123,13 @@ correct_tab(p(Vs,_,Ps),K,p(Vs,TDist,Ps)) :-
store_cl(Cl) :-
recordz(best_theory, Cl, _).
:- user:set(best_clause_hook, clpbn_aleph:add_new_clause).
add_new_clause(_,(_ :- true),_,_) :- !.
add_new_clause(_,(H :- B),_,_) :-
user:db_usage,
user:db_dynamic,
% user:db_usage,
% user:db_dynamic,
domain(H, K, V, D),
rewrite_body(B, IB, Vs, _, ( !, { V = K with p(D, CPTList, Vs) })),
% need to remember which CPT we want