Fixed discrete examples

release/4.3a0
Frank Dellaert 2012-05-25 15:10:13 +00:00
parent 14f119a787
commit de79924e73
2 changed files with 6 additions and 16 deletions

View File

@ -16,10 +16,9 @@ set (discrete_full_libs
gtsam_unstable-static) gtsam_unstable-static)
# Exclude tests that don't work # Exclude tests that don't work
set (discrete_excluded_tests #set (discrete_excluded_tests
"${CMAKE_CURRENT_SOURCE_DIR}/tests/testScheduler.cpp" #"${CMAKE_CURRENT_SOURCE_DIR}/tests/testScheduler.cpp"
#"${CMAKE_CURRENT_SOURCE_DIR}/tests/testCSP.cpp" #)
)
# Add all tests # Add all tests
@ -27,8 +26,8 @@ gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_fu
# List examples to build - comment out here to exclude from compilation # List examples to build - comment out here to exclude from compilation
set(discrete_unstable_examples set(discrete_unstable_examples
#schedulingExample schedulingExample
#schedulingQuals12 schedulingQuals12
) )
if (GTSAM_BUILD_EXAMPLES) if (GTSAM_BUILD_EXAMPLES)

View File

@ -105,7 +105,6 @@ namespace gtsam {
/** Add student-specific constraints to the graph */ /** Add student-specific constraints to the graph */
void Scheduler::addStudentSpecificConstraints(size_t i, boost::optional<size_t> slot) { void Scheduler::addStudentSpecificConstraints(size_t i, boost::optional<size_t> slot) {
#ifdef BROKEN
bool debug = ISDEBUG("Scheduler::buildGraph"); bool debug = ISDEBUG("Scheduler::buildGraph");
assert(i<nrStudents()); assert(i<nrStudents());
@ -134,7 +133,7 @@ namespace gtsam {
DiscreteKey dummy(0, nrTimeSlots()); DiscreteKey dummy(0, nrTimeSlots());
Potentials::ADT p(dummy & areaKey, available_); Potentials::ADT p(dummy & areaKey, available_);
Potentials::ADT q = p.choose(0, *slot); Potentials::ADT q = p.choose(0, *slot);
Constraint::shared_ptr f(new DecisionTreeFactor(areaKey, q)); DiscreteFactor::shared_ptr f(new DecisionTreeFactor(areaKey, q));
CSP::push_back(f); CSP::push_back(f);
} else { } else {
CSP::add(s.key_, areaKey, available_); CSP::add(s.key_, areaKey, available_);
@ -144,15 +143,11 @@ namespace gtsam {
// add mutex // add mutex
if (debug) cout << "Mutex for faculty" << endl; if (debug) cout << "Mutex for faculty" << endl;
addAllDiff(s.keys_[0] & s.keys_[1] & s.keys_[2]); addAllDiff(s.keys_[0] & s.keys_[1] & s.keys_[2]);
#else
throw runtime_error("addStudentSpecificConstraints is broken");
#endif
} }
/** Main routine that builds factor graph */ /** Main routine that builds factor graph */
void Scheduler::buildGraph(size_t mutexBound) { void Scheduler::buildGraph(size_t mutexBound) {
#ifdef BROKEN
bool debug = ISDEBUG("Scheduler::buildGraph"); bool debug = ISDEBUG("Scheduler::buildGraph");
if (debug) cout << "Adding student-specific constraints" << endl; if (debug) cout << "Adding student-specific constraints" << endl;
@ -178,10 +173,6 @@ namespace gtsam {
} }
} }
} }
#else
throw runtime_error("buildGraph is broken");
#endif
} // buildGraph } // buildGraph
/** print */ /** print */