-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add running initial "unit-test" for GePlanner
- Loading branch information
Showing
5 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
package lib.gecom; | ||
|
||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
|
||
import java.util.Optional; | ||
|
||
@NoArgsConstructor | ||
public class GeNullTarget implements GeTargetable { | ||
|
||
@NonNull | ||
@Override | ||
public Optional<Object> getTargetPosition() { | ||
return Optional.empty(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
package lib.gecom; | ||
|
||
import lombok.NonNull; | ||
|
||
import java.util.Optional; | ||
|
||
public interface GeTargetable { | ||
Object getTargetPosition(); | ||
|
||
@NonNull | ||
Optional<Object> getTargetPosition(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package lib.gecom; | ||
|
||
import lombok.NonNull; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.*; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
class GePlannerTest { | ||
|
||
@Test | ||
void plan() { | ||
// Arrange | ||
final GePlanner planner = new GePlanner(); | ||
@NonNull final List<GeAction> possibleActions = new ArrayList<>(); | ||
@NonNull final HashMap<String, Integer> goal = new HashMap<>(); | ||
@NonNull final GeWorldStates worldStates = new GeWorldStates(); | ||
|
||
// Act | ||
final Optional<Queue<GeAction>> planToTest = planner.plan(possibleActions, goal, worldStates); | ||
|
||
// Assert | ||
assertTrue(planToTest.isEmpty()); | ||
} | ||
|
||
} |