Open EvanKirshenbaum opened 9 months ago
This issue was referenced by the following commits before migration:
I've added the basic safety checks on motion and dispensing:
allow_unsafe
parameter is provided) unless
In all of these cases, we just delay a tick and re-check. The effect is that I now no longer need to add after
delay parameters to any of the tasks, including being able to schedule dispensing all drops for the mix
task at the same time.
Note that we may run into problems if the delays (especially in dispensing) wind up executed in a different order. As currently implemented, any that are delayed will always be retried in the same order, but I'm not sure what happens if another one gets added while we're checking. It might get tried (for the first time) before the others get re-checked.
This is not a full solution, as it doesn't address fairness or deadlock avoidance, but it should make creating the paths a fair bit simpler.
As I've been working on mixing (#21), I added a task that
In an effort to make that last step look good, I've spent far too much time working out the appropriate delays on paper. It would be really nice to see if I can figure out a way to have it done automatically.
To a first-order approximation, I basically want to say "if the place I want to walk to isn't safe" (i.e., is a neighbor of a cell with a drop) "wait and try again next time". That should sort of work, but I can see a couple of wrinkles:
where A wants to walk right two steps and then turn down and B wants to walk left two steps and then turn, on the next tick you'll have
and then you deadlock, as each sits there waiting for the other to get out of the way.
So, obviously, some more intricate scheduling would be needed.
Migrated from internal repository. Originally created by @EvanKirshenbaum on Jun 21, 2021 at 6:29 PM PDT.