14 #include <boost/assign/std/vector.hpp> 15 #include <boost/assign/std/map.hpp> 16 #include <boost/optional.hpp> 20 using namespace gtsam;
27 size_t nrFaculty = 4, nrTimeSlots = 3;
42 string faculty_in_A =
"1 0 0 1";
43 string faculty_in_C =
"0 0 1 0";
44 string faculty_in_H =
"0 0 0 1";
45 string faculty_in_M =
"0 1 0 0";
46 string faculty_in_P =
"1 0 1 0";
47 string available =
"1 1 1 0 1 1 1 1 0 1 1 1";
50 expected.
add(A1, faculty_in_A);
51 expected.
add(A1,
"1 1 1 0");
52 expected.
add(
A & A1, available);
53 expected.
add(A2, faculty_in_M);
54 expected.
add(A2,
"1 1 1 0");
55 expected.
add(
A & A2, available);
56 expected.
add(A3, faculty_in_P);
57 expected.
add(A3,
"1 1 1 0");
58 expected.
add(
A & A3, available);
63 expected.
add(J1, faculty_in_H);
64 expected.
add(J1,
"1 0 1 1");
65 expected.
add(J & J1, available);
66 expected.
add(J2, faculty_in_C);
67 expected.
add(J2,
"1 0 1 1");
68 expected.
add(J & J2, available);
69 expected.
add(J3, faculty_in_A);
70 expected.
add(J3,
"1 0 1 1");
71 expected.
add(J & J3, available);
78 return std::move(expected);
107 string available =
"1 1 1 0 1 1 1 1 0 1 1 1";
111 s.
addStudent(
"Akansel",
"AI",
"ME",
"PC",
"Andrea");
112 s.
addStudent(
"Jake",
"HR",
"CT",
"AI",
"Harvey");
149 TEST( schedulingExample, smallFromFile)
151 string path(TOPSRCDIR
"/gtsam_unstable/discrete/examples/");
164 s.
addStudent(
"Akansel",
"AI",
"ME",
"PC",
"Andrea");
165 s.
addStudent(
"Jake",
"HR",
"CT",
"AI",
"Harvey");
void add(const DiscreteKey &j, SOURCE table)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
void setAvailability(const std::string &available)
void addStudent(const std::string &studentName, const std::string &area1, const std::string &area2, const std::string &area3, const std::string &advisor)
DiscreteFactorGraph createExpected()
TEST(schedulingExample, test)
std::pair< Key, size_t > DiscreteKey
#define EXPECT(condition)
void addSlot(const std::string &slotName)
JacobiRotation< float > J
void buildGraph(size_t mutexBound=7)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
boost::shared_ptr< Values > sharedValues
void addAllDiff(const DiscreteKey &key1, const DiscreteKey &key2)
Add a binary AllDiff constraint.
void addArea(const std::string &facultyName, const std::string &areaName)
void addFaculty(const std::string &facultyName)
DecisionTreeFactor product() const
void product(const MatrixType &m)