15 using namespace gtsam;
21 size_t nrFaculty = 4, nrTimeSlots = 3;
36 string faculty_in_A =
"1 0 0 1";
37 string faculty_in_C =
"0 0 1 0";
38 string faculty_in_H =
"0 0 0 1";
39 string faculty_in_M =
"0 1 0 0";
40 string faculty_in_P =
"1 0 1 0";
41 string available =
"1 1 1 0 1 1 1 1 0 1 1 1";
44 expected.
add(
A1, faculty_in_A);
45 expected.
add(
A1,
"1 1 1 0");
46 expected.
add(
A &
A1, available);
47 expected.
add(A2, faculty_in_M);
48 expected.
add(A2,
"1 1 1 0");
49 expected.
add(
A & A2, available);
50 expected.
add(A3, faculty_in_P);
51 expected.
add(A3,
"1 1 1 0");
52 expected.
add(
A & A3, available);
57 expected.
add(J1, faculty_in_H);
58 expected.
add(J1,
"1 0 1 1");
59 expected.
add(J & J1, available);
60 expected.
add(J2, faculty_in_C);
61 expected.
add(J2,
"1 0 1 1");
62 expected.
add(J & J2, available);
63 expected.
add(J3, faculty_in_A);
64 expected.
add(J3,
"1 0 1 1");
65 expected.
add(J & J3, available);
72 return std::move(expected);
100 string available =
"1 1 1 0 1 1 1 1 0 1 1 1";
104 s.
addStudent(
"Akansel",
"AI",
"ME",
"PC",
"Andrea");
105 s.
addStudent(
"Jake",
"HR",
"CT",
"AI",
"Harvey");
142 TEST(schedulingExample, smallFromFile) {
143 string path(TOPSRCDIR
"/gtsam_unstable/discrete/examples/");
156 s.
addStudent(
"Akansel",
"AI",
"ME",
"PC",
"Andrea");
157 s.
addStudent(
"Jake",
"HR",
"CT",
"AI",
"Harvey");
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
DecisionTreeFactor product() const
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
void setAvailability(const std::string &available)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
void addStudent(const std::string &studentName, const std::string &area1, const std::string &area2, const std::string &area3, const std::string &advisor)
DiscreteValues optimize(OptionalOrderingType orderingType={}) const
Find the maximum probable explanation (MPE) by doing max-product.
void add(Args &&... args)
DiscreteFactorGraph createExpected()
TEST(schedulingExample, test)
#define EXPECT(condition)
void addSlot(const std::string &slotName)
JacobiRotation< float > J
void buildGraph(size_t mutexBound=7)
void addAllDiff(const DiscreteKey &key1, const DiscreteKey &key2)
Add a binary AllDiff constraint.
std::pair< Key, size_t > DiscreteKey
void addArea(const std::string &facultyName, const std::string &areaName)
void addFaculty(const std::string &facultyName)
void product(const MatrixType &m)