Class BeepFailureTestParticle
Simple algorithm to test beep failure feature.
All particles construct circuits along all six cardinal directions. The boundary particles send beeps in the opposite directions of their empty neighbors. All particles expect beeps on all of their partition sets. If one beep does not arrive, they change their color to red for the next round.
Namespace: AS2.Algos.BeepFailureTest
Assembly: .dll
Syntax
public class BeepFailureTestParticle : ParticleAlgorithm
Constructors
| Edit this page View SourceBeepFailureTestParticle(Particle)
Declaration
public BeepFailureTestParticle(Particle p)
Parameters
Type | Name | Description |
---|---|---|
Particle | p |
Fields
| Edit this page View SourcefirstRound
Declaration
private ParticleAttribute<bool> firstRound
Field Value
Type | Description |
---|---|
ParticleAttribute<bool> |
Properties
| Edit this page View SourceName
Declaration
public static string Name { get; }
Property Value
Type | Description |
---|---|
string |
PinsPerEdge
The number of pins on each edge.
This number must be the same constant for all particles.
Declaration
public override int PinsPerEdge { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
| Edit this page View SourceActivateBeep()
This is the second part of the main activation logic of the particle. It is called exactly once in each round, after the movements scheduled in ActivateMove() have been executed, and should contain the algorithm code that implements the look-compute-beep cycle.
Inside of this method, particles are allowed to change their pin configuration and send beeps and messages on the updated configuration.
Note that beeps and messages sent in the current round will be readable in both the ActivateMove() and ActivateBeep() calls in the next round.
Declaration
public override void ActivateBeep()
Overrides
| Edit this page View SourceActivateMove()
This is one part of the main activation logic of the particle. It is called exactly once in each round and should contain the algorithm code that implements the look-compute-move cycle. After the movements are executed, ActivateBeep() is called within the same round.
Inside of this method, particles are allowed to release bonds, define which bonds should be marked, and schedule movements. Only the last movement operation scheduled in this method will be applied.
Declaration
public override void ActivateMove()