-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add GPS receiver
device to provide senseloc
capability
#956
Conversation
What is going on? 😄
|
@xsebek In short, I think capability analysis is broken when there are multiple devices that provide multiple same capabilities. I've been working on #397 (which I think is the culprit) but don't quite have it all ironed out yet. See my comments on that issue. I'll see if I can finish that up next and hopefully it will resolve this as well. |
Unfortunately fixing #397 didn't resolve the failing test. The |
doh! swarm/src/Swarm/Game/Entity.hs Lines 295 to 296 in 629cff3
Hint: combining two |
Well, finally got the tests to pass. Even though #397 wasn't the cause I'm glad I thought it was, because it gave me the push to finally get that sorted. 😁 |
description: | | ||
Test the `whereami` command and GPS receiver device. | ||
https://github.com/swarm-game/swarm/issues/956 | ||
objectives: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a goal
here that explains what the solution is doing to meet the condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good idea. While I was at it I also thought of a way to make the test much better --- what do you think now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, using random
is great.
Add a new
GPS receiver
device which enables thesenseloc
capability (and hence thewhereami
command). Towards #26 .excursion : cmd unit -> cmd unit
which executes the given command and then returns to the same location and orientation as before. Being able to use thewhereami
command is one of the last missing pieces of machinery necessary to be able to do this in classic mode (the other is aheading
command, see Newheading
command #955).GPS receiver
isantenna + circuit + clock + compass
, which is a somewhat difficult recipe (antenna
requiressilver
which requires adeep mine
; aclock
requiresquartz
+ a bunch ofiron gears
, etc.). One might wonder whether we should make the recipe easier since finding out where you are seems like a kind of fundamental operation. However, consider that in order to even be able to make use of the result ofwhereami
you need at least (1) anADT calculator
to deal with the pair (which transitively requirestypewriter
->circuit
->silicon
->quartz
) (2) probably things likecomparator
andcalculator
to do anything useful with the coordinates. By the time you have those things you can definitely already buildcircuit
+clock
+compass
, and you're probably not that far away from getting somesilver
for anantenna
. Also, in practice it's an interesting/fun constraint to build up machinery that has to work entirely based on relative position without being able to find out your absolute coordinates.Testing/508-capability-subset
to fail. I think perhaps it is due to Wrong device reported missing #397 ? I will investigate. EDIT: unfortunately, that wasn't it!