Package net.sf.tweety.arg.adf.util
Class TestUtil
- java.lang.Object
-
- net.sf.tweety.arg.adf.util.TestUtil
-
public class TestUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_SOLUTION_EXTENSION
-
Constructor Summary
Constructors Constructor Description TestUtil()
-
Method Summary
Modifier and Type Method Description private static java.lang.Boolean
charToBool(char ch)
static boolean
equalInterpretations(Interpretation interpretation, java.util.Map<java.lang.String,java.lang.Boolean> map)
Checks if the different representations of interpretations are equal, i.e.static void
mergeSolutionFiles(java.lang.String dir, java.lang.String[] semantics, java.lang.String outputExtension)
Merges the solution files from solvers like diamond or k++adf into a single one.static java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Boolean>>>
readSolutionFile(java.io.File file)
Reads all models from the given solution file and groups them by their semantics.
-
-
-
Field Detail
-
DEFAULT_SOLUTION_EXTENSION
public static final java.lang.String DEFAULT_SOLUTION_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
mergeSolutionFiles
public static void mergeSolutionFiles(java.lang.String dir, java.lang.String[] semantics, java.lang.String outputExtension) throws java.io.IOException
Merges the solution files from solvers like diamond or k++adf into a single one. Allows us to keep the number of files per instance much lower since we must not store the models in a separate file for each semantics.- Parameters:
dir
- the pathsemantics
- the used semanticsoutputExtension
- some string- Throws:
java.io.IOException
- if some IO issue occurs
-
readSolutionFile
public static java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Boolean>>> readSolutionFile(java.io.File file) throws java.io.IOException
Reads all models from the given solution file and groups them by their semantics.- Parameters:
file
- the solution file- Returns:
- a mapping of all the models per semantic
- Throws:
java.io.IOException
- if an IO issue occurs
-
charToBool
private static java.lang.Boolean charToBool(char ch)
-
equalInterpretations
public static boolean equalInterpretations(Interpretation interpretation, java.util.Map<java.lang.String,java.lang.Boolean> map)
Checks if the different representations of interpretations are equal, i.e. all assignments are equal.- Parameters:
interpretation
- some interpretationmap
- some map from string to boolean- Returns:
- true if the different representations of interpretations are equal
-
-