-
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.
Merge branch 'main' into windows-support
- Loading branch information
Showing
31 changed files
with
306 additions
and
51 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
10 changes: 5 additions & 5 deletions
10
data/scenarios/Testing/1575-structure-recognizer/1575-browse-structures.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
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
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
75 changes: 75 additions & 0 deletions
75
data/scenarios/Testing/1575-structure-recognizer/1575-floorplan-command.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,75 @@ | ||
version: 1 | ||
name: Floorplan command | ||
description: | | ||
Query the dimensions of a structure | ||
template to build one. | ||
creative: false | ||
objectives: | ||
- teaser: Build structure | ||
goal: | ||
- | | ||
Build a `wooden box`{=structure} structure. | ||
condition: | | ||
def isRight = \x. case x (\_. false) (\_. true); end; | ||
foundBox <- structure "wooden box" 0; | ||
return $ isRight foundBox; | ||
robots: | ||
- name: base | ||
dir: [1, 0] | ||
devices: | ||
- ADT calculator | ||
- blueprint | ||
- branch predictor | ||
- comparator | ||
- dictionary | ||
- grabber | ||
- logger | ||
- treads | ||
inventory: | ||
- [100, board] | ||
solution: | | ||
def doN = \n. \f. if (n > 0) {f; doN (n - 1) f} {}; end; | ||
def mkRow = \width. | ||
doN width $ (place "board"; move;); | ||
turn back; | ||
doN width move; | ||
end; | ||
def mkRows = \height. \width. | ||
doN height $ (mkRow width; turn left; move; turn left); | ||
end; | ||
dims <- floorplan "wooden box"; | ||
let width = fst dims in | ||
let height = snd dims in | ||
mkRows height width; | ||
structures: | ||
- name: wooden box | ||
recognize: true | ||
structure: | ||
palette: | ||
'b': [stone, board] | ||
map: | | ||
bbbbbbb | ||
bbbbbbb | ||
bbbbbbb | ||
bbbbbbb | ||
bbbbbbb | ||
known: [board] | ||
world: | ||
dsl: | | ||
{blank} | ||
palette: | ||
'.': [grass, erase] | ||
'B': [grass, erase, base] | ||
upperleft: [0, 0] | ||
map: | | ||
.......... | ||
.B........ | ||
.......... | ||
.......... | ||
.......... | ||
.......... | ||
.......... |
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
111 changes: 111 additions & 0 deletions
111
data/scenarios/Testing/1575-structure-recognizer/1575-interior-entity-placement.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,111 @@ | ||
version: 1 | ||
name: Structure recognition - interior space | ||
description: | | ||
Entities can be added and removed | ||
on empty cells within the rectangular | ||
boundary of an already-placed structure without | ||
affecting its recognition status. | ||
Additionally, recognition of statically-placed | ||
structures at scenario initialization is also | ||
unaffected by interior entities. | ||
However, any such "contaminating" entities | ||
will prevent the recognition of a structure | ||
when constructed by a robot. | ||
creative: false | ||
objectives: | ||
- teaser: Replace rock | ||
prerequisite: grab_rock | ||
goal: | ||
- | | ||
Place the `rock`{=entity} entity back inside the `pigpen`{=structure}. | ||
condition: | | ||
foundBox <- structure "pigpen" 0; | ||
case foundBox (\_. return false) (\struc. | ||
let structPos = snd struc in | ||
j <- robotnamed "judge"; | ||
as j { | ||
structBounds <- floorplan "pigpen"; | ||
// Move to bottom-left corner | ||
teleport self structPos; | ||
rockCount <- resonate "rock" ((0, 0), structBounds); | ||
return $ rockCount > 0; | ||
} | ||
); | ||
- teaser: Grab rock | ||
id: grab_rock | ||
prerequisite: prerecognized | ||
goal: | ||
- | | ||
Grab an entity from inside a `pigpen`{=structure} structure. | ||
condition: | | ||
as base { | ||
has "rock"; | ||
} | ||
- teaser: Prerecognize | ||
id: prerecognized | ||
goal: | ||
- | | ||
`pigpen`{=structure} structure should be recognized upon initialization, | ||
even with an extraneous entity within its bounds. | ||
condition: | | ||
def isRight = \x. case x (\_. false) (\_. true); end; | ||
foundBox <- structure "pigpen" 0; | ||
return $ isRight foundBox; | ||
robots: | ||
- name: base | ||
dir: [1, 0] | ||
devices: | ||
- ADT calculator | ||
- blueprint | ||
- grabber | ||
- logger | ||
- treads | ||
- name: judge | ||
dir: [1, 0] | ||
system: true | ||
display: | ||
invisible: true | ||
solution: | | ||
move; move; | ||
x <- grab; | ||
move; | ||
place x; | ||
structures: | ||
- name: pigpen | ||
recognize: true | ||
structure: | ||
palette: | ||
'b': [stone, board] | ||
mask: '.' | ||
map: | | ||
bbbb | ||
b..b | ||
b..b | ||
bbbb | ||
known: [board, rock] | ||
world: | ||
dsl: | | ||
{blank} | ||
placements: | ||
- src: pigpen | ||
offset: [1, 0] | ||
- src: pigpen | ||
offset: [3, -6] | ||
palette: | ||
'.': [grass, erase] | ||
'B': [grass, erase, base] | ||
'r': [grass, rock] | ||
'j': [grass, erase, judge] | ||
upperleft: [-7, 3] | ||
map: | | ||
j..... | ||
...... | ||
B.r... | ||
...... | ||
...... | ||
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
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
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 |
---|---|---|
|
@@ -88,6 +88,7 @@ | |
"whereami" | ||
"waypoint" | ||
"structure" | ||
"floorplan" | ||
"detect" | ||
"resonate" | ||
"density" | ||
|
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
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
Oops, something went wrong.