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

[doc] minor addition: initCosts must be called before creating a weightedCSP

parent 36e7f6b7
// Cmake generated version
#define Toulbar_VERSION "1.0.0-49-g5168dff-master (1538937659)"
#define Toulbar_VERSION "1.0.0-111-gf9ad47d-master-tainted (1539612272)"
......@@ -451,6 +451,7 @@ public:
tb2init(); // must be call before setting specific ToulBar2 options and creating a model
// Create a solver object
initCosts(); // last check for compatibility issues between ToulBar2 options and Cost data-type
WeightedCSPSolver *solver = WeightedCSPSolver::makeWeightedCSPSolver(MAX_COST);
// Read a problem file in wcsp format
......
......@@ -34,6 +34,7 @@ int main(int argc, char* argv[])
// ToulBar2::vnsNeighborVarHeur = RANDOMVAR;
// create a problem with three 0/1 variables
initCosts(); // last check for compatibility issues between ToulBar2 options and Cost data-type
WeightedCSPSolver* solver = WeightedCSPSolver::makeWeightedCSPSolver(MAX_COST);
int x = solver->getWCSP()->makeEnumeratedVariable("x", 0, 1); // note that for efficiency issue, I assume domain values start at zero (otherwise remove flag -DWCSPFORMATONLY in Makefile)
int y = solver->getWCSP()->makeEnumeratedVariable("y", 0, 1);
......
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