Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix watch wakeup test #1791

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions data/scenarios/Testing/1598-detect-entity-change.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,26 @@ robots:
invisible: true
dir: [1, 0]
program: |
run "scenarios/Testing/_1598-detect-entity-change/setup.sw"
def doUntilCorrect =
herenow <- ishere "dial (G)";
if herenow {
give base "flower";
} {
loc <- whereami;
surveil loc;
wait 1000;
doUntilCorrect;
}
end;

def go =
doUntilCorrect;
end;

go;
inventory:
- [1, flower]
solution: |
wait 2;
move;
move;
swap "dial (G)";
Expand Down
17 changes: 0 additions & 17 deletions data/scenarios/Testing/_1598-detect-entity-change/setup.sw

This file was deleted.

10 changes: 7 additions & 3 deletions src/swarm-lang/Swarm/Language/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -827,9 +827,13 @@ constInfo c = case c of
, "Any change to entities at the monitored locations will cause the robot to wake up before the `wait` timeout."
]
Surveil ->
command 1 short . doc (Set.singleton $ Query $ Sensing EntitySensing) "Interrupt `wait` upon (remote) location changes." $
[ "Like `watch`, but with no restriction on distance."
]
command 1 Intangible $
doc
(Set.singleton $ Query $ Sensing EntitySensing)
"Interrupt `wait` upon (remote) location changes."
[ "Like `watch`, but instantaneous and with no restriction on distance."
, "Supply absolute coordinates."
]
Heading -> command 0 Intangible $ shortDoc (Set.singleton $ Query $ Sensing RobotSensing) "Get the current heading."
Blocked -> command 0 Intangible $ shortDoc (Set.singleton $ Query $ Sensing EntitySensing) "See if the robot can move forward."
Scan ->
Expand Down
Loading