Commit a7766cf6 authored by Simon de Givry's avatar Simon de Givry Committed by Thomas Schiex
Browse files

[option] --trws-n-iters-compute-ub : compute UB after/every N steps in TRW-S ;...

[option] --trws-n-iters-compute-ub : compute UB after/every N steps in TRW-S ; --trws-order : replaces DAC order by Kolmogorov TRW-S order ; STATIC compilation is now working ( but without MPI, XML, and jemalloc ) ; ZLIB should be at the end of library inclusion
parent 7601f7fd
......@@ -73,7 +73,7 @@ IF(CPLEX)
SET(CPLEX_LOCATION "/opt/ibm/ILOG/CPLEX_Studio126")
SET(CPLEXFLAGS "-fPIC -fexceptions -fno-strict-aliasing -DILOGCPLEX -DIL_STD -DILOSTRICTPOD -pthread -I${CPLEX_LOCATION}/cplex/include -I${CPLEX_LOCATION}/concert/include")
SET(CPLEXLIB "-L${CPLEX_LOCATION}/cplex/lib/x86-64_linux/static_pic -L${CPLEX_LOCATION}/concert/lib/x86-64_linux/static_pic")
SET(CMAKE_CXX_FLAGS " -Wall ${CPLEXFLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPLEXFLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS " ${CPLEXLIB}")
SET (all_depends ${all_depends} "ilocplex")
SET (all_depends ${all_depends} "cplex")
......@@ -88,7 +88,7 @@ ENDIF(CPLEX)
# thanks to alex rudnick
##########################################
IF(APPLE)
SET(CMAKE_CXX_FLAGS "-Wall -m64" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64" )
SET(CMAKE_SHARED_LINKER_FLAGS "-Wall -m64" )
SET(STATIC off)
ENDIF(APPLE)
......@@ -122,10 +122,13 @@ ENDIF(MPI)
##########################################
IF(STATIC)
set (CMAKE_CXX_FLAGS "-Wall -static -static-libgcc" )
MESSAGE(STATUS "STATIC COMPILATION ON (warning: boost and xml and MPI options not compliant with static link)")
SET(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL "Set to OFF to build static libraries" FORCE )
MESSAGE(STATUS "STATIC COMPILATION ON (warning: jemalloc, xml, and MPI options not compliant with static link)")
SET(WITH_MEM_JEMALLOC OFF)
SET(XML OFF)
SET(MPI OFF)
SET(BUILD_SHARED_LIBS OFF)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc -static-libstdc++")
ELSE()
SET(BUILD_SHARED_LIBS ON) #shared library building
ENDIF(STATIC)
......
......@@ -8,12 +8,13 @@ SET (source_files ${source_files} ${boost_file})
MESSAGE(STATUS "- boost flag on .")
find_package(Boost 1.34.1 REQUIRED COMPONENTS graph iostreams)
find_package(ZLIB)
#find_package(ZLIB)
MESSAGE(STATUS " Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
MESSAGE(STATUS " Boost_LIBRARIES: ${Boost_LIBRARIES}")
SET (all_depends ${all_depends} ${ZLIB_LIBRARIES} ${Boost_LIBRARIES})
#SET (all_depends ${all_depends} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
SET (all_depends ${all_depends} ${Boost_LIBRARIES} "z")
IF(NOT Boost_FOUND)
MESSAGE(ERROR "#################################")
......
......@@ -93,9 +93,9 @@ echo -n "\\item "
echo "Solve another WCSP using the original Russian Doll Search method~\\cite{Verfaillie96} with static variable"
echo "ordering (following problem file) and soft arc consistency:"
echo "\\begin{DoxyCode}"
echo " toulbar2 EXAMPLES/505.wcsp -B=3 -j=1 -svo -k=1"
echo " toulbar2 EXAMPLES/505.wcsp -B=3 -j=1 -svo -k=1 -trws:"
echo "\\end{DoxyCode}"
echo "{\\scriptsize" ; echo "\\begin{DoxyCode}" ; toulbar2 EXAMPLES/505.wcsp -B=3 -j=1 -svo -k=1 | awk '/^Read /{ok=1} /Solving cluster subtree 3 /{ok=1} ok{print $0} /Solving cluster subtree 2 /{ok=0;print "";print "...";print ""}'
echo "{\\scriptsize" ; echo "\\begin{DoxyCode}" ; toulbar2 EXAMPLES/505.wcsp -B=3 -j=1 -svo -k=1 -trws: | awk '/^Read /{ok=1} /Solving cluster subtree 3 /{ok=1} ok{print $0} /Solving cluster subtree 2 /{ok=0;print "";print "...";print ""}'
echo "\\end{DoxyCode}}"
echo -n "\\item "
......@@ -192,18 +192,18 @@ echo -n "\\item "
#echo "________________________________________________________________________________"
echo "Download a crisp CSP file {\\em GEOM40\\_6.wcsp} (initial upper bound equal to 1). Count the number of solutions using \#BTD~\\cite{Favier09a} using a min-fill variable ordering\\footnote{Warning, cannot use BTD to find all solutions in optimization.}:"
echo "\\begin{DoxyCode}"
echo " toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1"
echo " toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 -ub=1 -hbfs:"
echo "\\end{DoxyCode}"
echo "{\\scriptsize" ; echo "\\begin{DoxyCode}" ; toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 | awk '/^Read /{ok=1} ok{print $0}'
echo "{\\scriptsize" ; echo "\\begin{DoxyCode}" ; toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 -ub=1 -hbfs: | awk '/^Read /{ok=1} ok{print $0}'
echo "\\end{DoxyCode}}"
echo -n "\\item "
#echo "________________________________________________________________________________"
echo "Get a quick approximation of the number of solutions of a CSP with Approx\#BTD~\\cite{Favier09a}:"
echo "\\begin{DoxyCode}"
echo " toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 -D"
echo " toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 -D -ub=1 -hbfs:"
echo "\\end{DoxyCode}"
echo "{\\scriptsize" ; echo "\\begin{DoxyCode}" ; toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 -D | awk '/^Read /{ok=1} ok{print $0}'
echo "{\\scriptsize" ; echo "\\begin{DoxyCode}" ; toulbar2 EXAMPLES/GEOM40_6.wcsp -O=-3 -a -B=1 -D -ub=1 -hbfs: | awk '/^Read /{ok=1} ok{print $0}'
echo "\\end{DoxyCode}}"
#echo -n "\\item "
......
......@@ -199,11 +199,13 @@ or if no integer is given, finds all solutions (or counts the number of zero-cos
apply the Min Sum Diffusion algorithm (default is inactivated, with
a number of iterations of 0). See~\cite{Cooper10a}.
\item[{-trws=[float]}]
preprocessing only: enforce TRW-S until a given precision is reached (default value is 0.001). See Kolmogorov 2006.
preprocessing only: enforces TRW-S until a given precision is reached (default value is 0.001). See Kolmogorov 2006.
\item[{--trws-order}] replaces DAC order by Kolmogorov's TRW-S order.
\item[{--trws-n-iters=[integer]}] enforce at most N iterations of TRW-S (default value is 1000).
\item[{--trws-n-iters-no-change=[integer]}] stop TRW-S when N iterations did not change the lower bound up the given precision (default value is 5).
\item[{--trws-n-iters-no-change=[integer]}] stop TRW-S when N iterations did not change the lower bound up the given precision (default value is 5, -1=never).
\item[{--trws-n-iters-compute-ub=[integer]}] compute a basic upper bound every N steps during TRW-S (default value is 100)
\end{description}
\subsection{Initial upper bounding}
......@@ -312,7 +314,8 @@ or if no integer is given, finds all solutions (or counts the number of zero-cos
searches using dichotomic branching. The default d=1 splits domains
in the middle of domain range while d=2 splits domains in the middle
of the sorted domain based on unary costs.
\item[-sortd] sorts domains in preprocessing based on increasing unary costs ( works only for binary WCSPs).
\item[-sortd] sorts domains in preprocessing based on increasing unary costs (works only for binary WCSPs).
\item[-solr] solution-based phase saving (reuse last found solution as preferred value assignment in the value ordering heuristic) (default option).
\end{description}
\subsection{Console output}
......
// Cmake generated version
#define Toulbar_VERSION "1.0.0-119-g9e315c2-master-tainted (1540302449)"
#define Toulbar_VERSION "1.0.0-120-g4b4e357-master-tainted (1540827368)"
......@@ -428,9 +428,8 @@ public:
static string costThresholdPreS;
static Cost costThreshold;
static Cost costThresholdPre;
static unsigned int trwsFirst;
static double trwsAccuracy;
static unsigned int trwsOrder;
static bool trwsOrder;
static unsigned int trwsNIter;
static unsigned int trwsNIterNoChange;
static unsigned int trwsNIterComputeUb;
......
......@@ -285,7 +285,7 @@ bool VACVariable::averaging()
if (itc != getConstrs()->end())
ctr = (*itc).constr;
while (ctr) {
if (ctr->isBinary() && !ctr->isSep()) {
if (ctr->isBinary()) {
BinaryConstraint* bctr = (BinaryConstraint*)ctr;
x = (EnumeratedVariable*)bctr->getVarDiffFrom((Variable*)this);
for (iterator it = begin(); it != end(); ++it) {
......
......@@ -132,8 +132,7 @@ Cost ToulBar2::costThresholdPre;
string ToulBar2::costThresholdS;
string ToulBar2::costThresholdPreS;
double ToulBar2::trwsAccuracy;
unsigned int ToulBar2::trwsFirst;
unsigned int ToulBar2::trwsOrder;
bool ToulBar2::trwsOrder;
unsigned int ToulBar2::trwsNIter;
unsigned int ToulBar2::trwsNIterNoChange;
unsigned int ToulBar2::trwsNIterComputeUb;
......@@ -292,8 +291,7 @@ void tb2init()
ToulBar2::costThreshold = UNIT_COST;
ToulBar2::costThresholdPre = UNIT_COST;
ToulBar2::trwsAccuracy = 0.001;
ToulBar2::trwsFirst = 1;
ToulBar2::trwsOrder = 0;
ToulBar2::trwsOrder = false;
ToulBar2::trwsNIter = 1000;
ToulBar2::trwsNIterNoChange = 5;
ToulBar2::trwsNIterComputeUb = 100;
......@@ -1881,7 +1879,7 @@ void WCSP::preprocessing()
}
} while (getLb() > previouslb && 100. * (getLb() - previouslb) / getLb() > 0.5);
if ((ToulBar2::trwsAccuracy >= 0) && (ToulBar2::trwsFirst == 1))
if (ToulBar2::trwsAccuracy >= 0)
propagateTRWS();
if (ToulBar2::preprocessNary > 0) {
......@@ -1953,7 +1951,7 @@ void WCSP::preprocessing()
processTernary();
propagate();
if (ToulBar2::verbose >= 0 && getLb() > previouslb)
cout << "PIC lower bound: " << getLb() << " (+" << 100. * (getLb() - previouslb) / getLb() << "%, " << numberOfConstraints() << " cost functions)" << endl;
cout << "PIC dual bound: " << getLb() << " (+" << 100. * (getLb() - previouslb) / getLb() << "%, " << numberOfConstraints() << " cost functions)" << endl;
} while (getLb() > previouslb && 100. * (getLb() - previouslb) / getLb() > 0.5);
} else if (ToulBar2::preprocessNary > 0) {
processTernary();
......@@ -1971,9 +1969,6 @@ void WCSP::preprocessing()
propagate();
}
if ((ToulBar2::trwsAccuracy >= 0) && (ToulBar2::trwsFirst == 0))
propagateTRWS();
// Deconnect empty cost functions
unsigned int nbunvar;
do {
......@@ -2616,19 +2611,23 @@ void WCSP::propagateTRWS()
bool forwardPass = true;
unsigned int nIteration = 0;
unsigned int nIterationNoChange = 0;
Cost previousEbound = 0;
Cost ebound = 0;
Cost previousEbound = MIN_COST;
Cost ebound = MIN_COST;
Cost bestUb = getUb();
Cost newUb = numeric_limits<Cost>::max();
vector<int> orders[2] = { vector<int>(numberOfVariables()), vector<int>(numberOfVariables()) };
vector<unsigned int> ranks[2] = { vector<unsigned int>(numberOfVariables()), vector<unsigned int>(numberOfVariables()) };
vector<Cost> tmpM(getMaxDomainSize(), numeric_limits<Cost>::max());
vector < Value > bestPrimal (numberOfVariables());
vector < Value > bestPrimalVal (numberOfVariables(), 0);
vector < int > bestPrimalVar (numberOfVariables(), 0);
for (unsigned int i = 0; i < numberOfVariables(); ++i) {
bestPrimalVar[i] = i;
bestPrimalVal[i] = getSupport(i);
}
assert(!td); // warning! tree decomposition must be done after TRW-S
// Preprocessing: compute order
if (ToulBar2::trwsOrder == 0) {
if (ToulBar2::trwsOrder) {
// Use monotonic chains
unsigned int nVariableUsed = 0;
vector<bool> variableUsed(numberOfVariables(), false);
......@@ -2683,6 +2682,10 @@ void WCSP::propagateTRWS()
swap(ranks[0], ranks[1]);
}
if (ToulBar2::trwsOrder) {
setDACOrder(orders[0]);
}
// Preprocessing: compute gammas
for (unsigned int i = 0; i < numberOfVariables(); ++i)
if (unassigned(i) && enumerated(i)) {
......@@ -2721,7 +2724,7 @@ void WCSP::propagateTRWS()
do {
vector<int>& order = (forwardPass) ? orders[0] : orders[1];
vector<unsigned int>& rank = (forwardPass) ? ranks[0] : ranks[1];
ebound = 0;
ebound = MIN_COST;
for (unsigned int i = 0; i < numberOfVariables(); ++i) {
if (unassigned(order[i]) && enumerated(order[i])) {
if (ToulBar2::interrupted)
......@@ -2784,8 +2787,7 @@ void WCSP::propagateTRWS()
}
}
// step 3: compute ub
if ((!forwardPass) && (ToulBar2::trwsNIterComputeUb > 0) && (ToulBar2::trwsNIter % ToulBar2::trwsNIterComputeUb == 0)) {
newUb = 0;
if ((!forwardPass) && (ToulBar2::trwsNIterComputeUb > 0) && (nIteration > 0) && (nIteration % ToulBar2::trwsNIterComputeUb == 0)) {
for (unsigned int i = 0; i < numberOfVariables(); ++i) {
if (unassigned(order[i]) && enumerated(order[i])) {
EnumeratedVariable* s = static_cast<EnumeratedVariable*>(getVar(order[i]));
......@@ -2795,38 +2797,36 @@ void WCSP::propagateTRWS()
unsigned int j = s->toIndex(*sIter);
for (ConstraintList::iterator iter = s->getConstrs()->begin(); iter != s->getConstrs()->end(); ++iter) {
Constraint* constraint = (*iter).constr;
if (constraint->connected() && constraint->isBinary()) {
if (constraint->isBinary()) {
BinaryConstraint* binctr = static_cast<BinaryConstraint*>(constraint);
EnumeratedVariable* t = static_cast<EnumeratedVariable*>(binctr->getVarDiffFrom(s));
if (rank[s->wcspIndex] < rank[t->wcspIndex]) {
cost += binctr->trwsM[j];
}
else {
cost += binctr->getCost(s, t, *sIter, bestPrimal[t->wcspIndex]);
cost += binctr->getCost(s, t, *sIter, bestPrimalVal[t->wcspIndex]);
}
}
}
if (cost < bestCost) {
if (cost < bestCost || (cost == bestCost && s->getSupport()==*sIter)) {
bestCost = cost;
bestPrimal[s->wcspIndex] = *sIter;
bestPrimalVal[s->wcspIndex] = *sIter;
}
}
}
}
for (unsigned int i = 0; i < numberOfVariables(); ++i) {
if (unassigned(i) && enumerated(i)) {
EnumeratedVariable* s = static_cast<EnumeratedVariable*>(getVar(i));
newUb += s->getCost(bestPrimal[s->wcspIndex]);
}
int depth = Store::getDepth();
try {
Store::store();
assignLS(bestPrimalVar, bestPrimalVal);
assert(numberOfUnassignedVariables() == 0);
((Solver *) getSolver())->newSolution();
bestUb = min<Cost>(getUb(), bestUb);
} catch (Contradiction) {
whenContradiction();
}
for (unsigned int i = 0; i < numberOfConstraints(); i++) {
Constraint* ctr = getCtr(i);
if (ctr->connected() && ctr->isBinary()) {
BinaryConstraint* binctr = static_cast<BinaryConstraint*>(ctr);
newUb += binctr->getCost(bestPrimal[binctr->getVar(0)->wcspIndex], bestPrimal[binctr->getVar(1)->wcspIndex]);
}
}
bestUb = min<Cost>(newUb, bestUb);
Store::restore(depth);
enforceUb();
}
// step 4: reverse ordering
double change = 0.0;
......@@ -2835,10 +2835,12 @@ void WCSP::propagateTRWS()
change = (ebound == previousEbound) ? 0.0 : (double)(ebound - previousEbound + 1) / (getLb() + ebound + 1);
nIterationNoChange = (change > ToulBar2::trwsAccuracy) ? 0 : nIterationNoChange + 1;
if (ToulBar2::verbose >= 0 && !nIterationNoChange) {
Double Dglb = (ToulBar2::costMultiplier >= 0 ? Cost2ADCost(getLb() + ebound) : Cost2ADCost(bestUb));
Double Dgub = (ToulBar2::costMultiplier >= 0 ? Cost2ADCost(bestUb) : Cost2ADCost(getLb() + ebound));
if (ToulBar2::uai)
cout << "TRW-S dual bound: " << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(getLb() + ebound) << std::setprecision(DECIMAL_POINT) << " energy: " << -(Cost2LogProb(getLb() + ebound) + ToulBar2::markov_log) << " -- " << Cost2ADCost(getLb() + bestUb) << std::setprecision(DECIMAL_POINT) << " energy: " << -(Cost2LogProb(getLb() + bestUb) + ToulBar2::markov_log) << " (+" << (100 * change) << "%) (accuracy: " << (100.0 * (Cost2ADCost(getLb() + bestUb) - Cost2ADCost(getLb() + ebound)) / (Cost2ADCost(getLb() + bestUb))) << "%) (iter:" << nIteration << ")" << endl;
cout << "TRW-S dual bound: " << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(getLb() + ebound) << std::setprecision(DECIMAL_POINT) << " energy: " << -(Cost2LogProb(getLb() + ebound) + ToulBar2::markov_log) << " -- primal bound: " << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(bestUb) << std::setprecision(DECIMAL_POINT) << " energy: " << -(Cost2LogProb(bestUb) + ToulBar2::markov_log) << " (+" << (100 * change) << "%) (accuracy: " << (100.0 * (bestUb - ebound - getLb()) / (bestUb + 1)) << "%) (iter:" << nIteration << ")" << endl;
else
cout << "TRW-S bounds: [" << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(getLb() + ebound) << ", " << Cost2ADCost(getLb() + bestUb) << std::setprecision(DECIMAL_POINT) << "[ (+" << (100 * change) << "%) (accuracy: " << (100.0 * (Cost2ADCost(getLb() + bestUb) - Cost2ADCost(getLb() + ebound)) / (Cost2ADCost(getLb() + bestUb))) << "%) (iter:" << nIteration << ")" << endl;
cout << "TRW-S bounds: [" << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Dglb << ", " << Dgub << std::setprecision(DECIMAL_POINT) << "[ (+" << (100 * change) << "%) (accuracy: " << (100.0 * (bestUb - ebound - getLb()) / (bestUb + 1)) << "%) (iter:" << nIteration << ")" << endl;
}
previousEbound = ebound;
}
......@@ -2846,8 +2848,9 @@ void WCSP::propagateTRWS()
} while ((nIteration < ToulBar2::trwsNIter) && (nIterationNoChange < ToulBar2::trwsNIterNoChange));
// step 5: move to WCSP
ToulBar2::trwsAccuracy = -1; // stop TRW-S such that VAC can be done
if (ebound <= MIN_COST) {
if (ToulBar2::verbose >= 0) {
if (ToulBar2::verbose >= 1) {
cout << "TRW-S did not improve the lower bound." << endl;
}
}
......@@ -2923,7 +2926,6 @@ void WCSP::propagateTRWS()
increaseLb(delta);
propagate(); // propagate again without TRWS and possibly with VAC
}
if (ToulBar2::trwsFirst == 1) ToulBar2::trwsAccuracy = -1; // stop TRW-S such that VAC can be done
}
void WCSP::fillEAC2()
......@@ -3145,8 +3147,7 @@ void WCSP::propagate()
if (ToulBar2::LcLevel < LC_EDAC || CSP(getLb(), getUb()))
EAC1.clear();
//if (ToulBar2::vac && !(ToulBar2::trwsAccuracy >= 0) && !CSP(getLb(), getUb())) {
if (ToulBar2::vac && ((ToulBar2::trwsAccuracy < 0) || (ToulBar2::trwsFirst == 0)) && !CSP(getLb(), getUb())) {
if (ToulBar2::vac && (ToulBar2::trwsAccuracy < 0) && !CSP(getLb(), getUb())) {
// assert(verify());
if (vac->firstTime()) {
vac->init();
......
......@@ -1130,7 +1130,6 @@ void Solver::singletonConsistency()
void Solver::newSolution()
{
assert(unassignedVars->empty());
#ifndef NDEBUG
bool allVarsAssigned = true;
for (unsigned int i = 0; i < wcsp->numberOfVariables(); i++) {
......
......@@ -201,7 +201,6 @@ protected:
void binaryChoicePointLDS(int xIndex, Value value, int discrepancy);
void narySortedChoicePoint(int xIndex, Cost lb = MIN_COST);
void narySortedChoicePointLDS(int xIndex, int discrepancy);
virtual void newSolution();
void recursiveSolve(Cost lb = MIN_COST);
void recursiveSolveLDS(int discrepancy);
Value postponeRule(int varIndex);
......@@ -248,6 +247,7 @@ public:
void read_solution(const char* fileName, bool updateValueHeuristic = true);
void parse_solution(const char* certificate);
virtual void newSolution();
Cost getSolution(vector<Value>& solution);
friend void setvalue(int wcspId, int varIndex, Value value, void* solver);
......
......@@ -178,8 +178,8 @@ enum {
OPT_costThreshold,
OPT_costThresholdPre,
OPT_trwsAccuracy,
OPT_trwsFirst,
OPT_trwsOrder,
NO_OPT_trwsOrder,
OPT_trwsNIter,
OPT_trwsNIterNoChange,
OPT_trwsNIterComputeUb,
......@@ -363,8 +363,8 @@ CSimpleOpt::SOption g_rgOptions[] = {
{ NO_OPT_trws, (char*)"-trws:", SO_NONE },
{ OPT_trwsAccuracy, (char*)"-trws", SO_REQ_SEP },
{ OPT_trwsAccuracy, (char*)"--trws-accuracy", SO_REQ_SEP },
{ OPT_trwsFirst, (char*)"--trws-first", SO_REQ_SEP },
{ OPT_trwsOrder, (char*)"--trws-order", SO_REQ_SEP },
{ OPT_trwsOrder, (char*)"--trws-order", SO_NONE },
{ NO_OPT_trwsOrder, (char*)"--trws-order:", SO_NONE },
{ OPT_trwsNIter, (char*)"--trws-n-iters", SO_REQ_SEP },
{ OPT_trwsNIterNoChange, (char*)"--trws-n-iters-no-change", SO_REQ_SEP },
{ OPT_trwsNIterComputeUb, (char*)"--trws-n-iters-compute-ub", SO_REQ_SEP },
......@@ -754,9 +754,11 @@ void help_msg(char* toulbar2filename)
if (ToulBar2::vacValueHeuristic)
cout << " (default option)";
cout << endl;
cout << " -trws=[float] : enforce TRW-S in preprocessing until given precision is reached (default value is " << ToulBar2::trwsAccuracy << ")" << endl;
cout << " --trws-first=[integer] : 0: VAC then TRW-S, 1: TRW-S then VAC (default value is " << ToulBar2::trwsFirst << ")" << endl;
cout << " --trws-order=[integer] : 0: TRW-S order, 1: DAC order (default value is " << ToulBar2::trwsOrder << ")" << endl;
cout << " -trws=[float] : enforces TRW-S in preprocessing until a given precision is reached (default value is " << ToulBar2::trwsAccuracy << ")" << endl;
cout << " --trws-order : replaces DAC order by Kolmogorov's TRW-S order";
if (ToulBar2::trwsOrder)
cout << " (default option)";
cout << endl;
cout << " --trws-n-iters=[integer] : enforce at most N iterations of TRW-S (default value is " << ToulBar2::trwsNIter << ")" << endl;
cout << " --trws-n-iters-no-change=[integer] : stop TRW-S when N iterations did not change the lower bound up the given precision (default value is " << ToulBar2::trwsNIterNoChange << ", -1=never)" << endl;
cout << " --trws-n-iters-compute-ub=[integer] : compute UB every N steps in TRW-S (default value is " << ToulBar2::trwsNIterComputeUb << ")" << endl;
......@@ -1420,11 +1422,10 @@ int _tmain(int argc, TCHAR* argv[])
else
ToulBar2::trwsAccuracy = -1.;
}
if (args.OptionId() == OPT_trwsFirst) {
ToulBar2::trwsFirst = atol(args.OptionArg());
}
if (args.OptionId() == OPT_trwsOrder) {
ToulBar2::trwsOrder = atol(args.OptionArg());
ToulBar2::trwsOrder = true;
} else if (args.OptionId() == NO_OPT_trwsOrder) {
ToulBar2::trwsOrder = false;
}
if (args.OptionId() == OPT_trwsNIter) {
ToulBar2::trwsNIter = atol(args.OptionArg());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment