Skip to content

Commit

Permalink
Adding first release.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonpereira committed Oct 11, 2017
1 parent f7135e2 commit c7340e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<classpathentry kind="lib" path="lib/planning-landmarks2.3.jar"/>
<classpathentry kind="lib" path="lib/planning-utils2.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
</classpath>
Binary file added goalrecognizer1.0.jar
Binary file not shown.
36 changes: 20 additions & 16 deletions src/recognizer/GoalRecognizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,53 @@ public class GoalRecognizer {

public static void main(String[] args) {
try {
if (args.length < 3 || args.length > 7){
printUsage();
} else if(args.length == 3){
if(args.length == 3){
String goalRecognitionFile = args[1];
float threshold = Float.valueOf(args[2]);
if(args[0] == "filter"){
if(args[0].equals("-filter")){
GoalRecognitionFilter filter = new GoalRecognitionFilter(goalRecognitionFile, threshold);
filter.filter(false);
} else if(args[0] == "goalcompletion"){
} else if(args[0].equals("-goalcompletion")){
GoalCompletionHeuristic gc = new GoalCompletionHeuristic(goalRecognitionFile, threshold);
gc.recognize();
} else if(args[0] == "uniqueness"){
} else if(args[0].equals("-uniqueness")){
LandmarkUniquenessHeuristic uniq = new LandmarkUniquenessHeuristic(goalRecognitionFile, threshold);
uniq.recognize();
} else printUsage();
} else {
printUsage();
}
} else if(args.length == 7){
String domain = args[1];
String problem = args[2];
String goals = args[3];
String observations = args[4];
String correctGoal = args[5];
float threshold = Float.valueOf(args[6]);
if(args[0] == "filter"){
if(args[0].equals("-filter")){
GoalRecognitionFilter filter = new GoalRecognitionFilter(domain, problem, goals, observations, correctGoal, threshold);
filter.filter(false);
} else if(args[0] == "goalcompletion"){
} else if(args[0].equals("-goalcompletion")){
GoalCompletionHeuristic gc = new GoalCompletionHeuristic(domain, problem, goals, observations, correctGoal, threshold);
gc.recognize();
} else if(args[0] == "uniqueness"){
} else if(args[0].equals("-uniqueness")){
LandmarkUniquenessHeuristic uniq = new LandmarkUniquenessHeuristic(domain, problem, goals, observations, correctGoal, threshold);
uniq.recognize();
} else printUsage();
} else printUsage();
} else {
printUsage();
}
} else {
printUsage();
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}

private static void printUsage(){
System.out.println("- Option (1) - Parameters needed: <filter | goalcompletion | uniqueness> <tar.bz2 file> <threshold_value>");
System.out.println("\t $> Example: filter goal_recognition-problem.tar.bz2 0.1");
System.out.println("- Option (1) - Parameters needed: <-filter | -goalcompletion | -uniqueness> <tar.bz2 file> <threshold_value>");
System.out.println("\t $> Example: -filter goal_recognition-problem.tar.bz2 0.1");
System.out.println("\nor\n");
System.out.println("- Option (2) - Parameters needed: <filter | goalcompletion | uniqueness> <domain.pddl> <problem.pddl> <goals.dat> <observations.dat> <correct_goal.dat> <threshold_value>");
System.out.println("\t $> Example: goalcompletion domain.pddl template.pddl hyps.dat obs.dat real_hyp.dat 0.15");
System.out.println("- Option (2) - Parameters needed: <-filter | -goalcompletion | -uniqueness> <domain.pddl> <problem.pddl> <goals.dat> <observations.dat> <correct_goal.dat> <threshold_value>");
System.out.println("\t $> Example: -goalcompletion domain.pddl template.pddl hyps.dat obs.dat real_hyp.dat 0.15");
}
}

0 comments on commit c7340e2

Please sign in to comment.