-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
772 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
836-path-exists-find-location.yaml | ||
836-path-exists-find-entity.yaml | ||
836-path-exists-distance-limit-unreachable.yaml | ||
836-path-exists-distance-limit-reachable.yaml | ||
836-no-path-exists1.yaml | ||
836-no-path-exists2.yaml | ||
836-automatic-waypoint-navigation.yaml |
153 changes: 153 additions & 0 deletions
153
data/scenarios/Testing/836-pathfinding/836-automatic-waypoint-navigation.yaml
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,153 @@ | ||
version: 1 | ||
name: Automatic navigation between waypoints | ||
description: | | ||
Demonstrate shortest-path patrolling between waypoints | ||
creative: false | ||
solution: | | ||
run "scenarios/Testing/836-pathfinding/_836-automatic-waypoint-navigation/patrol.sw" | ||
objectives: | ||
- goal: | ||
- Collect 64 eggs | ||
condition: | | ||
as base { | ||
eggCount <- count "egg"; | ||
return $ eggCount >= 64; | ||
}; | ||
attrs: | ||
- name: easter_egg | ||
fg: "#ffff88" | ||
bg: "#eebbff" | ||
entities: | ||
- name: wayfinder | ||
display: | ||
char: 'w' | ||
description: | ||
- Enables `path` command | ||
properties: [known, portable] | ||
capabilities: [path] | ||
- name: atlas | ||
display: | ||
char: 'a' | ||
description: | ||
- Enables `waypoint` command | ||
properties: [known, portable] | ||
capabilities: [waypoint] | ||
- name: kudzu | ||
display: | ||
char: 'k' | ||
attr: plant | ||
description: | ||
- Dense, impassable plant. | ||
properties: [known, unwalkable, growable] | ||
growth: [30, 50] | ||
- name: egg | ||
display: | ||
char: 'o' | ||
attr: easter_egg | ||
description: | ||
- Just the flower top of the plant | ||
properties: [known, portable] | ||
growth: [5, 10] | ||
robots: | ||
- name: base | ||
loc: [0, 0] | ||
dir: [1, 0] | ||
devices: | ||
- ADT calculator | ||
- atlas | ||
- branch predictor | ||
- comparator | ||
- compass | ||
- dictionary | ||
- grabber | ||
- logger | ||
- net | ||
- scanner | ||
- treads | ||
- wayfinder | ||
- name: gardener | ||
dir: [1, 0] | ||
system: true | ||
devices: | ||
- ADT calculator | ||
- branch predictor | ||
- comparator | ||
- compass | ||
- dictionary | ||
- harvester | ||
- treads | ||
- logger | ||
display: | ||
invisible: true | ||
program: | | ||
run "scenarios/Testing/836-pathfinding/_836-automatic-waypoint-navigation/gardener.sw" | ||
- name: rabbit | ||
dir: [1, 0] | ||
loc: [2, -2] | ||
system: true | ||
devices: | ||
- treads | ||
- logger | ||
inventory: | ||
- [64, egg] | ||
display: | ||
invisible: false | ||
attr: snow | ||
char: R | ||
program: | | ||
run "scenarios/Testing/836-pathfinding/_836-automatic-waypoint-navigation/rabbit.sw" | ||
known: [flower, boulder, kudzu] | ||
world: | ||
upperleft: [-1, 1] | ||
palette: | ||
'.': [grass] | ||
'k': [stone, kudzu, gardener] | ||
'┌': [stone, upper left corner] | ||
'┐': [stone, upper right corner] | ||
'└': [stone, lower left corner] | ||
'┘': [stone, lower right corner] | ||
'─': [stone, horizontal wall] | ||
'│': [stone, vertical wall] | ||
structures: | ||
- name: bigbox | ||
structure: | ||
palette: | ||
'.': [dirt] | ||
'@': [dirt, boulder] | ||
'w': | ||
cell: [dirt] | ||
waypoint: | ||
name: wp | ||
map: | | ||
@@@ | ||
@w. | ||
@.@ | ||
placements: | ||
- src: bigbox | ||
offset: [2, -2] | ||
orient: | ||
up: north | ||
- src: bigbox | ||
offset: [8, -2] | ||
orient: | ||
up: east | ||
- src: bigbox | ||
offset: [8, -6] | ||
orient: | ||
up: south | ||
- src: bigbox | ||
offset: [2, -6] | ||
orient: | ||
up: west | ||
map: | | ||
┌───────────┐ | ||
│...........│ | ||
│...........│ | ||
│.....k.....│ | ||
│...........│ | ||
│...........│ | ||
│...........│ | ||
│.....k.....│ | ||
│...........│ | ||
│...........│ | ||
└───────────┘ |
48 changes: 48 additions & 0 deletions
48
data/scenarios/Testing/836-pathfinding/836-no-path-exists1.yaml
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,48 @@ | ||
version: 1 | ||
name: Builtin pathfinding, unreachable goal, enclosed robot | ||
description: | | ||
There is finite area to explore, so | ||
this will terminate quickly. | ||
creative: false | ||
objectives: | ||
- goal: | ||
- Flower must not be reachable. | ||
condition: | | ||
as base { | ||
nextDir <- path (inL ()) (inR "flower"); | ||
return $ case nextDir (\_. true) (\_. false); | ||
}; | ||
solution: | | ||
noop; | ||
entities: | ||
- name: wayfinder | ||
display: | ||
char: 'w' | ||
description: | ||
- Enables `path` command | ||
properties: [known, portable] | ||
capabilities: [path] | ||
robots: | ||
- name: base | ||
dir: [1,0] | ||
devices: | ||
- treads | ||
- logger | ||
- ADT calculator | ||
- dictionary | ||
- wayfinder | ||
known: [mountain, flower, tree] | ||
world: | ||
palette: | ||
'B': [grass, null, base] | ||
'.': [grass] | ||
'x': [stone, mountain] | ||
'f': [grass, flower] | ||
'T': [grass, tree] | ||
upperleft: [0, 0] | ||
map: | | ||
xxxxx...... | ||
x...x...... | ||
x.B.x...f.. | ||
x...x...... | ||
xxxxx...... |
52 changes: 52 additions & 0 deletions
52
data/scenarios/Testing/836-pathfinding/836-no-path-exists2.yaml
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,52 @@ | ||
version: 1 | ||
name: Builtin pathfinding, unreachable goal, enclosed goal | ||
description: | | ||
There is infinite area to explore, so | ||
this will fail to terminate unless | ||
a limit is set on the max distance. | ||
In this scenario, we fall back onto the internal distance limit. | ||
Normally, it would be very expensive to allow this goal condition | ||
check to run upon every tick. But in this case, we should | ||
have won the scenario by the first tick. | ||
creative: false | ||
objectives: | ||
- goal: | ||
- Flower must not be reachable. | ||
condition: | | ||
as base { | ||
nextDir <- path (inL ()) (inR "flower"); | ||
return $ case nextDir (\_. true) (\_. false); | ||
}; | ||
solution: | | ||
noop; | ||
entities: | ||
- name: wayfinder | ||
display: | ||
char: 'w' | ||
description: | ||
- Enables `path` command | ||
properties: [known, portable] | ||
capabilities: [path] | ||
robots: | ||
- name: base | ||
dir: [1,0] | ||
devices: | ||
- treads | ||
- logger | ||
- ADT calculator | ||
- dictionary | ||
- wayfinder | ||
world: | ||
palette: | ||
'B': [grass, null, base] | ||
'.': [grass] | ||
'x': [stone, mountain] | ||
'f': [grass, flower] | ||
upperleft: [0, 0] | ||
map: | | ||
......xxxxx | ||
......x...x | ||
..B...x.f.x | ||
......x...x | ||
......xxxxx |
34 changes: 34 additions & 0 deletions
34
data/scenarios/Testing/836-pathfinding/836-path-exists-distance-limit-reachable.yaml
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,34 @@ | ||
version: 1 | ||
name: Builtin pathfinding - entity target | ||
description: | | ||
Use distance limit with `path` command | ||
creative: false | ||
objectives: | ||
- goal: | ||
- Flower must be reachable within 3 cells. | ||
condition: | | ||
as base { | ||
nextDir <- path (inR 3) (inR "flower"); | ||
return $ case nextDir (\_. false) (\_. true); | ||
}; | ||
solution: | | ||
move; | ||
robots: | ||
- name: base | ||
dir: [1,0] | ||
devices: | ||
- treads | ||
- logger | ||
- 3D printer | ||
- dictionary | ||
- grabber | ||
world: | ||
palette: | ||
'B': [grass, null, base] | ||
'.': [grass] | ||
'f': [grass, flower] | ||
upperleft: [0, 0] | ||
map: | | ||
....... | ||
.B...f. | ||
....... |
36 changes: 36 additions & 0 deletions
36
data/scenarios/Testing/836-pathfinding/836-path-exists-distance-limit-unreachable.yaml
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,36 @@ | ||
version: 1 | ||
name: Builtin pathfinding - entity target | ||
description: | | ||
Use distance limit with `path` command | ||
creative: false | ||
objectives: | ||
- goal: | ||
- Flower must NOT be reachable within 3 cells. | ||
condition: | | ||
as base { | ||
nextDir <- path (inR 3) (inR "flower"); | ||
return $ case nextDir (\_. true) (\_. false); | ||
}; | ||
solution: | | ||
turn back; | ||
move; | ||
robots: | ||
- name: base | ||
dir: [1,0] | ||
devices: | ||
- treads | ||
- logger | ||
- 3D printer | ||
- dictionary | ||
- grabber | ||
world: | ||
palette: | ||
'B': [grass, null, base] | ||
'.': [grass] | ||
'f': [grass, flower] | ||
upperleft: [0, 0] | ||
map: | | ||
....... | ||
..B..f. | ||
....... | ||
47 changes: 47 additions & 0 deletions
47
data/scenarios/Testing/836-pathfinding/836-path-exists-find-entity.yaml
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,47 @@ | ||
version: 1 | ||
name: Builtin pathfinding - entity target | ||
description: | | ||
Use `path` command to navigate to an entity | ||
creative: false | ||
objectives: | ||
- goal: | ||
- Get the flower. | ||
condition: | | ||
as base {has "flower";} | ||
solution: | | ||
run "scenarios/Testing/836-pathfinding/_836-path-exists/find-entity-solution.sw"; | ||
entities: | ||
- name: wayfinder | ||
display: | ||
char: 'w' | ||
description: | ||
- Enables `path` command | ||
properties: [known, portable] | ||
capabilities: [path] | ||
robots: | ||
- name: base | ||
dir: [1,0] | ||
devices: | ||
- ADT calculator | ||
- branch predictor | ||
- comparator | ||
- compass | ||
- dictionary | ||
- logger | ||
- grabber | ||
- treads | ||
- wayfinder | ||
known: [flower, mountain] | ||
world: | ||
palette: | ||
'B': [grass, null, base] | ||
'.': [grass] | ||
'x': [stone, mountain] | ||
'f': [grass, flower] | ||
upperleft: [0, 0] | ||
map: | | ||
xxxxfx | ||
x.Bx.x | ||
x.xx.x | ||
x....x | ||
xxxxxx |
Oops, something went wrong.