BayesChef now reports MSE of evidence and hidden recipe flavor combos.
Also, improved formatting of output to show exactly which flavors were included in the calculations.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
package net.woodyfolsom.cs6601.p2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
|
||||
@XStreamAlias("ing")
|
||||
@@ -12,6 +17,16 @@ public class Ingredient {
|
||||
return item;
|
||||
}
|
||||
|
||||
public Set<TYPE> getTypes() {
|
||||
Set<TYPE> types = new HashSet<TYPE>();
|
||||
for (TYPE type : TYPE.values()) {
|
||||
if (isType(type)) {
|
||||
types.add(type);
|
||||
}
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
||||
public boolean isType(TYPE type) {
|
||||
switch (type) {
|
||||
case BEEF :
|
||||
|
||||
Reference in New Issue
Block a user