Namespace AS2.Subroutines.BoundaryTest
Classes
SubBoundaryTest
Subroutine implementation of BoundaryTestParticle.
Usage:
- Initialize by calling Init(bool). All amoebots must participate in the subroutine.
- Run SetupPC(PinConfiguration), then SetNextPinConfiguration(PinConfiguration) (if necessary) and ActivateSend() to start the procedure.
- In the round immediately following a ActivateSend() call, ActivateReceive() must be called. There can be an arbitrary break until the next pin configuration setup and ActivateSend() call. Continue this until the procedure is finished.
- You can call IsFinished() immediately after ActivateReceive() to check whether the procedure is finished. If it is, you can find the number of boundaries an amoebot is part of using NumBoundaries() and get boundary information with IsBoundaryLeader(int), IsOuterBoundary(int), GetBoundaryPredecessor(int) and GetBoundarySuccessor(int).