comment debug information in some prolog files

This commit is contained in:
Tiago Gomes 2012-04-12 18:35:29 +01:00
parent 9def6c2b15
commit 5348c4a989
8 changed files with 33 additions and 37 deletions

View File

@ -63,17 +63,17 @@ call_bp_ground(QueryKeys, AllKeys, Factors, Evidence, Output) :-
get_factors_type(Factors, Type), get_factors_type(Factors, Type),
evidence_to_ids(Evidence, Hash, EvidenceIds), evidence_to_ids(Evidence, Hash, EvidenceIds),
factors_to_ids(Factors, Hash, FactorIds), factors_to_ids(Factors, Hash, FactorIds),
writeln(type:Type), writeln(''), %writeln(type:Type), writeln(''),
writeln(allKeys:AllKeys), writeln(''), %writeln(allKeys:AllKeys), writeln(''),
writeln(factors:Factors), writeln(''), %writeln(factors:Factors), writeln(''),
writeln(factorIds:FactorIds), writeln(''), %writeln(factorIds:FactorIds), writeln(''),
writeln(evidence:Evidence), writeln(''), %writeln(evidence:Evidence), writeln(''),
writeln(evidenceIds:EvidenceIds), writeln(''), %writeln(evidenceIds:EvidenceIds), writeln(''),
create_ground_network(Type, FactorIds, EvidenceIds, Network), create_ground_network(Type, FactorIds, EvidenceIds, Network),
%get_vars_information(AllKeys, StatesNames), %get_vars_information(AllKeys, StatesNames),
%set_vars_information(AllKeys, StatesNames), %set_vars_information(AllKeys, StatesNames),
run_solver(ground(Network,Hash), QueryKeys, Solutions), run_solver(ground(Network,Hash), QueryKeys, Solutions),
writeln(answer:Solutions), %writeln(answer:Solutions),
%clpbn_bind_vals([QueryKeys], Solutions, Output). %clpbn_bind_vals([QueryKeys], Solutions, Output).
free_ground_network(Network). free_ground_network(Network).
@ -82,8 +82,8 @@ run_solver(ground(Network,Hash), QueryKeys, Solutions) :-
%get_dists_parameters(DistIds, DistsParams), %get_dists_parameters(DistIds, DistsParams),
%set_factors_params(Network, DistsParams), %set_factors_params(Network, DistsParams),
list_of_keys_to_ids(QueryKeys, Hash, QueryIds), list_of_keys_to_ids(QueryKeys, Hash, QueryIds),
writeln(queryKeys:QueryKeys), writeln(''), %writeln(queryKeys:QueryKeys), writeln(''),
writeln(queryIds:QueryIds), writeln(''), %writeln(queryIds:QueryIds), writeln(''),
list_of_keys_to_ids(QueryKeys, Hash, QueryIds), list_of_keys_to_ids(QueryKeys, Hash, QueryIds),
run_ground_solver(Network, [QueryIds], Solutions). run_ground_solver(Network, [QueryIds], Solutions).

View File

@ -167,7 +167,7 @@ CFactorGraph::createGroups (void)
groupsHaveChanged = prevVarGroupsSize != varGroups.size() groupsHaveChanged = prevVarGroupsSize != varGroups.size()
|| prevFactorGroupsSize != facGroups.size(); || prevFactorGroupsSize != facGroups.size();
} }
printGroups (varGroups, facGroups); // printGroups (varGroups, facGroups);
createClusters (varGroups, facGroups); createClusters (varGroups, facGroups);
} }

View File

@ -24,10 +24,6 @@ CbpSolver::CbpSolver (const FactorGraph& fg) : BpSolver (fg)
Statistics::updateCompressingStatistics (nGroundVars, Statistics::updateCompressingStatistics (nGroundVars,
nGroundFacs, nClusterVars, nClusterFacs, nWithoutNeighs); nGroundFacs, nClusterVars, nClusterFacs, nWithoutNeighs);
} }
Util::printHeader ("Uncompressed Factor Graph");
fg.print();
Util::printHeader ("Compressed Factor Graph");
fg_->print();
} }

View File

@ -23,10 +23,10 @@ CC=@CC@
CXX=@CXX@ CXX=@CXX@
# normal # normal
#CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../../.. -I$(srcdir)/../../../../include @CPPFLAGS@ -DNDEBUG CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../../.. -I$(srcdir)/../../../../include @CPPFLAGS@ -DNDEBUG
# debug # debug
CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../../.. -I$(srcdir)/../../../../include @CPPFLAGS@ -g -O0 -Wextra #CXXFLAGS= -std=c++0x @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../../../.. -I$(srcdir)/../../../../include @CPPFLAGS@ -g -O0 -Wextra
# #
@ -105,10 +105,10 @@ OBJS = \
BpSolver.o \ BpSolver.o \
CbpSolver.o \ CbpSolver.o \
FoveSolver.o \ FoveSolver.o \
Parfactor.o \ Parfactor.o \
ProbFormula.o \ ProbFormula.o \
Histogram.o \ Histogram.o \
ParfactorList.o \ ParfactorList.o \
LiftedUtils.o \ LiftedUtils.o \
Util.o \ Util.o \
HorusYap.o HorusYap.o
@ -126,11 +126,11 @@ HCLI_OBJS = \
VarElimSolver.o \ VarElimSolver.o \
BpSolver.o \ BpSolver.o \
CbpSolver.o \ CbpSolver.o \
FoveSolver.o \ FoveSolver.o \
Parfactor.o \ Parfactor.o \
ProbFormula.o \ ProbFormula.o \
Histogram.o \ Histogram.o \
ParfactorList.o \ ParfactorList.o \
LiftedUtils.o \ LiftedUtils.o \
Util.o \ Util.o \
HorusCli.o HorusCli.o

View File

@ -1,6 +1,6 @@
if [ $1 ] && [ $1 == "clear" ]; then if [ $1 ] && [ $1 == "clear" ]; then
rm *~ rm -f *~
rm -f school/*.log school/*~ rm -f school/*.log school/*~
rm -f city/*.log city/*~ rm -f city/*.log city/*~
rm -f workshop_attrs/*.log workshop_attrs/*~ rm -f workshop_attrs/*.log workshop_attrs/*~

View File

@ -1,4 +1,4 @@
#!/home/tiago/bin/yap -L -- #!/home/tgomes/bin/yap -L --
:- initialization(main). :- initialization(main).

View File

@ -20,14 +20,14 @@ function run_all_graphs
echo "results for solver $1" >> $LOG_FILE echo "results for solver $1" >> $LOG_FILE
echo -n "**********************************" >> $LOG_FILE echo -n "**********************************" >> $LOG_FILE
echo "**********************************" >> $LOG_FILE echo "**********************************" >> $LOG_FILE
run_solver pop_10 $2 #run_solver pop_10 $2
#run_solver pop_1000 $2 run_solver pop_1000 $2
#run_solver pop_5000 $2 run_solver pop_5000 $2
#run_solver pop_10000 $2 run_solver pop_10000 $2
#run_solver pop_50000 $2 run_solver pop_50000 $2
#run_solver pop_100000 $2 run_solver pop_100000 $2
#run_solver pop_500000 $2 run_solver pop_500000 $2
#run_solver pop_1000000 $2 run_solver pop_1000000 $2
} }

View File

@ -50,8 +50,8 @@ init_fove_solver(_, AllAttVars, _, fove(ParfactorList, DistIds)) :-
get_dist_ids(Parfactors, DistIds0), get_dist_ids(Parfactors, DistIds0),
sort(DistIds0, DistIds), sort(DistIds0, DistIds),
get_observed_vars(AllAttVars, ObservedVars), get_observed_vars(AllAttVars, ObservedVars),
writeln(parfactors:Parfactors:'\n'), %writeln(parfactors:Parfactors:'\n'),
writeln(evidence:ObservedVars:'\n'), %writeln(evidence:ObservedVars:'\n'),
create_lifted_network(Parfactors,ObservedVars,ParfactorList). create_lifted_network(Parfactors,ObservedVars,ParfactorList).
@ -140,9 +140,9 @@ get_dists_parameters([Id|Ids], [dist(Id, Params)|DistsInfo]) :-
run_fove_solver(QueryVarsAtts, Solutions, fove(ParfactorList, DistIds)) :- run_fove_solver(QueryVarsAtts, Solutions, fove(ParfactorList, DistIds)) :-
get_query_vars(QueryVarsAtts, QueryVars), get_query_vars(QueryVarsAtts, QueryVars),
writeln(queryVars:QueryVars), writeln(''), %writeln(queryVars:QueryVars), writeln(''),
get_dists_parameters(DistIds, DistsParams), get_dists_parameters(DistIds, DistsParams),
writeln(dists:DistsParams), writeln(''), %writeln(dists:DistsParams), writeln(''),
set_parfactors_params(ParfactorList, DistsParams), set_parfactors_params(ParfactorList, DistsParams),
run_lifted_solver(ParfactorList, QueryVars, Solutions). run_lifted_solver(ParfactorList, QueryVars, Solutions).