Hi all,
first of all: Thanks for this great piece of software.
From reading the documentation of the Arbitrator class, I have undersood that the Arbitrator is permanently monitoring its Behaviours, asking them whether they want to be active. (Hope this is right, I did not look into the code.) Although I guess that it Thread.yield()s now and then, this still means that this is basically a busy waiting approach. What was the reason for this design decision? In particular, this means that the behaviours cannot check whenever takeControl() is called, because in theory the condition necessary to trigger this behaviour might have been missed already.
If I would have implemented from scratch (actually I did not expect this library to come with high-level utilities for behaviour programming, so this was in fact a positive surprise), I would probably have taken an event-driven approach where the arbitrator listens for changes in priority or changes of an equivalent of takeControl() and suppress()es the current activity when necessary. Is there any reason in the leJOS environment why such an approach would not be recommended?
Best,
Simon
