This commit is contained in:
dkohl
2012-03-12 20:52:50 -04:00
parent 6e2507f92e
commit 9235ff8d0f
4 changed files with 125 additions and 96 deletions

View File

@@ -221,12 +221,12 @@ public class FoodNetBuilder {
public static BayesNet createDishNet(Survey survey, RecipeBook recipeBook, int startIndex, int endIndex) {
BayesNet net = new BayesNet(VARIABLES);
net.setDistribution(new Variable(SOMEONE_VEGETARIAN, DOMAIN), vegi(survey));
// net.setDistribution(new Variable(SOMEONE_VEGETARIAN, DOMAIN), vegi(survey));
//net.setDistribution(new Variable(SOMEONE_ALLERGIC_NUTS, DOMAIN), allergicNuts(survey));
net.setDistribution(new Variable(CONTAINS_MEAT, DOMAIN), meat());
//net.setDistribution(new Variable(CONTAINS_NUTS, DOMAIN), nuts());
net.setDistribution(new Variable(SOMEONE_VEGETARIAN, DOMAIN), vegi(survey));
net.setDistribution(new Variable(CONTAINS_VEGETABLE, DOMAIN),
vegetables());
net.setDistribution(new Variable(CONTAINS_BEEF, DOMAIN), beef());
@@ -238,11 +238,12 @@ public class FoodNetBuilder {
net.setDistribution(new Variable(TASTE, RATING_DOMAIN), taste());
Ontology ontology = createOntology();
for (String category : ontology.getClasses()) {
net.connect(category, SOMEONE_VEGETARIAN);
/*net.connect(category, SOMEONE_ALLERGIC_NUTS);*/
}
// for (String category : ontology.getClasses()) {
// net.connect(category, SOMEONE_VEGETARIAN);
// /*net.connect(category, SOMEONE_ALLERGIC_NUTS);*/
// }
net.connect(SOMEONE_VEGETARIAN, CONTAINS_MEAT);
for (String thing : OBSERVED) {
net.connect(thing, ontology.getInheritance().get(thing));
net.connect(TASTE, thing);