diff --git a/examples/discrete_vs_nodiscrete.rs b/examples/discrete_vs_nodiscrete.rs index a55b61c..dda68a8 100644 --- a/examples/discrete_vs_nodiscrete.rs +++ b/examples/discrete_vs_nodiscrete.rs @@ -108,7 +108,7 @@ fn main() { FixedTimeSATSolver::without_optimality_check(soln.clone()); let optimality_proof_dur = timer.elapsed(); - let sat_flexible_time_problem = sat_flexible_time_model::Problem { requests }; + let sat_flexible_time_problem = sat_flexible_time_model::Problem { requests, dependencies: vec![] , one_of_dependencies: vec![]}; let stop = Arc::new(AtomicBool::new(false)); diff --git a/src/algorithms/sat_flexible_time_model.rs b/src/algorithms/sat_flexible_time_model.rs index 5064cd8..2a4a2ca 100644 --- a/src/algorithms/sat_flexible_time_model.rs +++ b/src/algorithms/sat_flexible_time_model.rs @@ -22,6 +22,12 @@ pub struct Problem { /// A vector of requests. A solved problem will satisfy at least one "alternative" /// within a request. pub requests: Vec>, + + /// Dependency one of the + pub one_of_dependencies: Vec>, + + /// Dependency of the form (a, b) where a is the request id and b is the alternative id. + pub dependencies: Vec<((usize, usize), (usize, usize))> } impl Problem { @@ -959,6 +965,8 @@ fn test_flexible_one_item_sat_solver() { let problem = Problem { requests: vec![req1], + one_of_dependencies: vec![], + dependencies: vec![] }; let stop = Arc::new(AtomicBool::new(false)); @@ -1022,6 +1030,8 @@ fn test_flexible_two_items_sat_solver() { let problem = Problem { requests: vec![req1, req2], + one_of_dependencies: vec![], + dependencies: vec![] }; let stop = Arc::new(AtomicBool::new(false)); @@ -1067,7 +1077,7 @@ fn test_flexible_n_items_sat_solver() { }]); } - let problem = Problem { requests }; + let problem = Problem { requests, dependencies: vec![], one_of_dependencies: vec![] }; let stop = Arc::new(AtomicBool::new(false)); let model = SATFlexibleTimeModel { @@ -1112,7 +1122,7 @@ fn test_flexible_no_soln_sat_solver() { }]); } - let problem = Problem { requests }; + let problem = Problem { requests, one_of_dependencies: vec![], dependencies: vec![] }; let stop = Arc::new(AtomicBool::new(false)); let model = SATFlexibleTimeModel { diff --git a/src/database/mod.rs b/src/database/mod.rs index 46e88b4..905454a 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -374,7 +374,10 @@ impl