Works on ingredients
This commit is contained in:
1 parent
28afe8ece0
commit
d3259c82b3
10 files changed
+151
-61
No files matched your search
@@ -14,6 +14,7 @@ use self::planner::solver::{Variables, Domain, Problem};
|
||||
type Day = String;
|
||||
const DAYS: &[&str] = &["Lundi", "Mardi", "Mercredi"];
|
||||
|
||||
#[allow(dead_code)]
|
||||
enum Meals {
|
||||
Breakfast(Day),
|
||||
Lunch(Day),
|
||||
@@ -41,8 +42,9 @@ fn generate_variables<V>(domain: &Domain<V>) -> Vec<(String, &Domain<V>, Option<
|
||||
}
|
||||
|
||||
fn ingredients_contains<'a>(assign: &Variables<'a,Recipe>) -> bool {
|
||||
assign.get("Lundi_Lunch").unwrap().unwrap().ingredients.contains("Patates")
|
||||
&& !assign.get("Mardi_Lunch").unwrap().unwrap().ingredients.contains("Patates")
|
||||
let id = 0;
|
||||
assign.get("Lundi_Lunch").unwrap().unwrap().ingredients.contains(&id)
|
||||
&& !assign.get("Mardi_Lunch").unwrap().unwrap().ingredients.contains(&id)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user