-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boolean expressions of objective prerequisites
Closes #795
- Loading branch information
Showing
55 changed files
with
1,955 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ stan.html | |
|
||
.swarm_history | ||
|
||
*.orig | ||
*.aux | ||
*.log | ||
docs/ott/*.tex | ||
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
795-prerequisite-or.yaml | ||
795-prerequisite-and.yaml | ||
795-prerequisite-mutually-exclusive.yaml | ||
795-prerequisite-cycle-with-not.yaml |
50 changes: 50 additions & 0 deletions
50
data/scenarios/Testing/795-prerequisite/795-prerequisite-and.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,50 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: AND | ||
description: | | ||
Complete an objective with a prerequisite of either of two other objectives. | ||
objectives: | ||
- goal: | ||
- Achieve both of two other objectives | ||
condition: | | ||
return true; | ||
prerequisite: | ||
previewable: true | ||
logic: | ||
and: | ||
- id: have_furnace | ||
- id: have_gear | ||
- goal: | ||
- Make a "furnace". | ||
condition: | | ||
as base {has "furnace"}; | ||
id: have_furnace | ||
optional: true | ||
- goal: | ||
- Make a "wooden gear". | ||
condition: | | ||
as base {has "wooden gear"}; | ||
id: have_gear | ||
optional: true | ||
solution: | | ||
make "furnace"; | ||
make "wooden gear"; | ||
robots: | ||
- name: base | ||
display: | ||
char: 'Ω' | ||
attr: robot | ||
dir: [0, 1] | ||
devices: | ||
- workbench | ||
- grabber | ||
inventory: | ||
- [2, board] | ||
- [5, rock] | ||
world: | ||
default: [blank] | ||
palette: | ||
'x': [grass, null, base] | ||
upperleft: [0, 0] | ||
map: | | ||
x |
46 changes: 46 additions & 0 deletions
46
data/scenarios/Testing/795-prerequisite/795-prerequisite-cycle-with-not.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,46 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: non-dependency cycle due to the NOT | ||
description: | | ||
This should NOT be rejected by the parser. | ||
The two objectives do reference each other, | ||
but the NOT is a distinct reference from the non-negated goal. | ||
objectives: | ||
- goal: | ||
- Make a "furnace". | ||
condition: | | ||
as base {has "furnace"}; | ||
id: have_furnace | ||
prerequisite: | ||
logic: | ||
not: | ||
id: have_gear | ||
- goal: | ||
- Make a "wooden gear". | ||
condition: | | ||
as base {has "wooden gear"}; | ||
id: have_gear | ||
prerequisite: | ||
logic: | ||
id: have_furnace | ||
solution: | | ||
make "wooden gear"; | ||
make "furnace"; | ||
robots: | ||
- name: base | ||
display: | ||
char: 'Ω' | ||
attr: robot | ||
dir: [0, 1] | ||
devices: | ||
- workbench | ||
inventory: | ||
- [2, board] | ||
- [5, rock] | ||
world: | ||
default: [blank] | ||
palette: | ||
'x': [grass, null, base] | ||
upperleft: [0, 0] | ||
map: | | ||
x |
60 changes: 60 additions & 0 deletions
60
data/scenarios/Testing/795-prerequisite/795-prerequisite-mutually-exclusive.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,60 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: OR | ||
description: | | ||
Complete an objective with a prerequisite of either of two other objectives. | ||
objectives: | ||
- goal: | ||
- Achieve one of two other objectives | ||
condition: | | ||
return true; | ||
prerequisite: | ||
previewable: true | ||
logic: | ||
or: | ||
- and: | ||
- id: have_furnace | ||
- not: | ||
id: have_flower | ||
- and: | ||
- id: have_gear | ||
- id: have_flower | ||
- goal: | ||
- Make a "furnace". | ||
condition: | | ||
as base {has "furnace"}; | ||
id: have_furnace | ||
optional: true | ||
- goal: | ||
- Make a "wooden gear". | ||
condition: | | ||
as base {has "wooden gear"}; | ||
id: have_gear | ||
optional: true | ||
- goal: | ||
- Possess a "flower". | ||
condition: | | ||
as base {has "flower"}; | ||
id: have_flower | ||
optional: true | ||
solution: | | ||
make "furnace" | ||
robots: | ||
- name: base | ||
display: | ||
char: 'Ω' | ||
attr: robot | ||
dir: [0, 1] | ||
devices: | ||
- workbench | ||
- grabber | ||
inventory: | ||
- [2, board] | ||
- [5, rock] | ||
world: | ||
default: [blank] | ||
palette: | ||
'x': [grass, flower, base] | ||
upperleft: [0, 0] | ||
map: | | ||
x |
49 changes: 49 additions & 0 deletions
49
data/scenarios/Testing/795-prerequisite/795-prerequisite-or.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,49 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: OR | ||
description: | | ||
Complete an objective with a prerequisite of either of two other objectives. | ||
objectives: | ||
- goal: | ||
- Achieve one of two other objectives | ||
condition: | | ||
return true; | ||
prerequisite: | ||
previewable: true | ||
logic: | ||
or: | ||
- id: have_furnace | ||
- id: have_gear | ||
- goal: | ||
- Make a "furnace". | ||
condition: | | ||
as base {has "furnace"}; | ||
id: have_furnace | ||
optional: true | ||
- goal: | ||
- Make a "wooden gear". | ||
condition: | | ||
as base {has "wooden gear"}; | ||
id: have_gear | ||
optional: true | ||
solution: | | ||
make "wooden gear" | ||
robots: | ||
- name: base | ||
display: | ||
char: 'Ω' | ||
attr: robot | ||
dir: [0, 1] | ||
devices: | ||
- workbench | ||
- grabber | ||
inventory: | ||
- [2, board] | ||
- [5, rock] | ||
world: | ||
default: [blank] | ||
palette: | ||
'x': [grass, flower, base] | ||
upperleft: [0, 0] | ||
map: | | ||
x |
42 changes: 42 additions & 0 deletions
42
data/scenarios/Testing/_Validation/795-prerequisite-cycle.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,42 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: dependency cycle | ||
description: | | ||
This should be rejected by the parser. | ||
objectives: | ||
- goal: | ||
- Make a "furnace". | ||
condition: | | ||
as base {has "furnace"}; | ||
id: have_furnace | ||
prerequisite: | ||
logic: | ||
id: have_gear | ||
- goal: | ||
- Make a "wooden gear". | ||
condition: | | ||
as base {has "wooden gear"}; | ||
id: have_gear | ||
prerequisite: | ||
logic: | ||
id: have_furnace | ||
solution: | | ||
make "wooden gear" | ||
robots: | ||
- name: base | ||
display: | ||
char: 'Ω' | ||
attr: robot | ||
dir: [0, 1] | ||
devices: | ||
- workbench | ||
inventory: | ||
- [2, board] | ||
- [5, rock] | ||
world: | ||
default: [blank] | ||
palette: | ||
'x': [grass, null, base] | ||
upperleft: [0, 0] | ||
map: | | ||
x |
40 changes: 40 additions & 0 deletions
40
data/scenarios/Testing/_Validation/795-prerequisite-nonexistent-reference.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,40 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: Nonexistent reference | ||
description: | | ||
This scenario should be unparseable due to typo "shave_furnace" vs "have_furnace" | ||
objectives: | ||
- goal: | ||
- Achieve one of two other objectives | ||
condition: | | ||
return true; | ||
prerequisite: | ||
logic: | ||
id: shave_furnace | ||
- goal: | ||
- Make a "furnace". | ||
condition: | | ||
as base {has "furnace"}; | ||
id: have_furnace | ||
optional: true | ||
solution: | | ||
make "furnace" | ||
robots: | ||
- name: base | ||
display: | ||
char: 'Ω' | ||
attr: robot | ||
dir: [0, 1] | ||
devices: | ||
- workbench | ||
- grabber | ||
inventory: | ||
- [2, board] | ||
- [5, rock] | ||
world: | ||
default: [blank] | ||
palette: | ||
'x': [grass, flower, base] | ||
upperleft: [0, 0] | ||
map: | | ||
x |
Oops, something went wrong.