Skip to content

Commit

Permalink
Temporary fix to AbstractToolWithRandomWalk
Browse files Browse the repository at this point in the history
Temporarily comment out Enum code which does not work anymore with learnlib 0.17.0.
The parts that will have to be rewritten are currently commented out and marked with
a `FIXME` note.
  • Loading branch information
kostis committed Feb 7, 2024
1 parent 64a4c73 commit acb1d9e
Showing 1 changed file with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.logging.Level;

import de.learnlib.logging.Category;
Expand All @@ -43,7 +43,6 @@ public abstract class AbstractToolWithRandomWalk implements RaLibTool {
public static final String LEARNER_SLSTAR = "slstar";
public static final String LEARNER_RADT = "sldt";


protected static final ConfigurationOption.StringOption OPTION_LEARNER
= new ConfigurationOption.StringOption("learner",
"Learning Algorithm: " + LEARNER_SLSTAR + " (default) or " +
Expand All @@ -68,12 +67,13 @@ public Level parse(Configuration c) throws ConfigurationException {
}
};

protected static final ConfigurationOption<EnumSet<Category>> OPTION_LOGGING_CATEGORY
= new ConfigurationOption<EnumSet<Category>>("logging.category", "Log category",
EnumSet.allOf(Category.class), true) {
protected static final ConfigurationOption<Set<Category>> OPTION_LOGGING_CATEGORY
= new ConfigurationOption<Set<Category>>("logging.category", "Log category",
null, // XXX: WAS: Set.allOf(Category.class), FIXME
true) {

@Override
public EnumSet<Category> parse(Configuration c) throws ConfigurationException {
public Set<Category> parse(Configuration c) throws ConfigurationException {
if (!c.containsKey(this.getKey())) {
if (!this.isOptional()) {
throw new ConfigurationException("Missing config value for " + this.getKey());
Expand All @@ -85,33 +85,34 @@ public EnumSet<Category> parse(Configuration c) throws ConfigurationException {
for (String n : names) {
list.add(parseCategory(n));
}
EnumSet<Category> ret = EnumSet.copyOf(list);
Set<Category> ret = Set.copyOf(list);
return ret;
}

private Category parseCategory(String n) throws ConfigurationException {
n = n.toUpperCase();
switch (n) {
case "CONFIG":
return Category.CONFIG;
//return Category.CONFIG;
case "COUNTEREXAMPLE":
return Category.COUNTEREXAMPLE;
//return Category.COUNTEREXAMPLE;
case "DATASTRUCTURE":
return Category.DATASTRUCTURE;
//return Category.DATASTRUCTURE;
case "EVENT":
return Category.EVENT;
//return Category.EVENT;
case "MODEL":
return Category.MODEL;
//return Category.MODEL;
case "PHASE":
return Category.PHASE;
//return Category.PHASE;
case "PROFILING":
return Category.PROFILING;
//return Category.PROFILING;
case "QUERY":
return Category.QUERY;
//return Category.QUERY;
case "STATISTIC":
return Category.STATISTIC;
//return Category.STATISTIC;
case "SYSTEM":
return Category.SYSTEM;
//return Category.SYSTEM;
return null; // XXX: Temporary solution -- FIXME
}
throw new ConfigurationException("can not parse " + this.getKey() + ": " + n);
}
Expand Down

0 comments on commit acb1d9e

Please sign in to comment.