Basic FitnessEvaluator tries 10x to generate a level containing between 8 and 16 level components.

This commit is contained in:
Woody Folsom
2012-03-18 11:33:18 -04:00
parent d6516388ad
commit 7b6baaa538
3 changed files with 33 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ public class LevelGrammarFactory {
if (line.length() == 0 || line.startsWith("#")) {
continue;
}
System.out.println("Read: " + line);
//System.out.println("Read: " + line);
//split on whitespace
String[] fields;
if (line.startsWith("VAR")) {
@@ -37,7 +37,7 @@ public class LevelGrammarFactory {
} else if (line.startsWith("RULE")) {
fields = line.split("->");
String ruleName = fields[0].split("\\s")[1];
System.out.println("Rule name: " + ruleName);
//System.out.println("Rule name: " + ruleName);
Variable lhs = levelGrammar.getVariable(ruleName);
if (lhs == null) {
throw new RuntimeException("LHS variable not found: " + ruleName);
@@ -74,7 +74,7 @@ public class LevelGrammarFactory {
if (lBraceIndex != -1) {
isOrClause = true;
rBraceIndex = clause.indexOf("}");
System.out.println("Read OR-clause probabilities from: " + lBraceIndex + " to " + rBraceIndex);
//System.out.println("Read OR-clause probabilities from: " + lBraceIndex + " to " + rBraceIndex);
String[] doubleFields = clause.substring(lBraceIndex+1,rBraceIndex).split(",");
chances = new double[doubleFields.length];
for (int i = 0; i < doubleFields.length; i++) {