Use only one interface for options.

set_pfl_flag/2 now can be called for setting options for solvers written in Prolog and for solvers in Horus.
This commit is contained in:
Tiago Gomes 2013-01-10 22:10:22 +00:00
parent e5e224d89b
commit fdeca2852a
2 changed files with 9 additions and 3 deletions

View File

@ -69,6 +69,9 @@
run_pcg_solver/3
]).
:- use_module('clpbn/horus',
[set_horus_flag/2]).
:- use_module('clpbn/horus_ground',
[call_horus_ground_solver/6,
check_if_horus_ground_solver_done/1,
@ -201,6 +204,9 @@ clpbn_flag(output,Before,After) :-
retract(output(Before)),
assert(output(After)).
clpbn_flag(HorusKey,_Before,After) :-
set_horus_flag(HorusKey,After).
set_solver(Solver) :-
set_clpbn_flag(solver,Solver).

View File

@ -292,11 +292,11 @@ For instance, if we want to use belief propagation to solve some probabilistic q
\texttt{?- set\_solver(bp).}
It is possible to tweak some parameters of PFL through \texttt{set\_horus\_flag/2} predicate. The first argument is a key that identifies the parameter that we want to tweak. The second argument is some possible value for this key.
It is possible to tweak some parameters of PFL through \texttt{set\_pfl\_flag/2} predicate. The first argument is a key that identifies the parameter that we want to tweak. The second argument is some possible value for this key.
The \texttt{verbosity} key controls the level of debugging information that will be printed. Its possible values are positive integers. The higher the number, the more information that will be shown. For instance, we can view some basic debugging information by calling the following goal.
\texttt{?- set\_horus\_flag(verbosity, 1).}
\texttt{?- set\_pfl\_flag(verbosity, 1).}
This key defaults to 0 (no debugging) and only \texttt{hve}, \texttt{bp}, \texttt{cbp}, \texttt{lve}, \texttt{lkc} and \texttt{lbp} solvers have support for this key.
@ -382,7 +382,7 @@ By default, all probability tasks are resolved using the \texttt{hve} solver. It
Notice that only the \texttt{hve}, \texttt{bp} and \texttt{cbp} solvers can be used with \texttt{hcli}.
The options that are available with the \texttt{set\_horus\_flag/2} predicate can be used in \texttt{hcli} too. The syntax is a pair \texttt{<Key>=<Value>} before the model's file name.
The options that are available with the \texttt{set\_pfl\_flag/2} predicate can be used in \texttt{hcli} too. The syntax is a pair \texttt{<Key>=<Value>} before the model's file name.