Class Unrolling
Implements the unrolling algorithm.
See https://doi.org/10.4230/LIPIcs.SAND.2026.11.
The unrolling of a spiral into a line, which preserves the order of the amoebots.
The algorithm repeatedly executes the shearing primitive, starting on the outermost segment and going inward to unroll the spiral into a line.
The algorithm requires O(c) rounds, where c is the number of corners in the spiral.
Inheritance
object
Unrolling
Assembly: .dll
Syntax
public class Unrolling : Suboracle<Unrolling>
Constructors
|
Edit this page
View Source
Unrolling(Particle)
Declaration
public Unrolling(Particle rep)
Parameters
Fields
|
Edit this page
View Source
anchor
Declaration
private ParticleAlgorithm anchor
Field Value
|
Edit this page
View Source
clockwise
Declaration
Field Value
|
Edit this page
View Source
count
Declaration
Field Value
|
Edit this page
View Source
currentPos
Declaration
private ParticleAlgorithm currentPos
Field Value
|
Edit this page
View Source
directionIn
Declaration
private Direction directionIn
Field Value
|
Edit this page
View Source
directionOut
Declaration
private Direction directionOut
Field Value
|
Edit this page
View Source
first
Declaration
Field Value
|
Edit this page
View Source
hideBonds
Declaration
private List<ParticleAlgorithm> hideBonds
Field Value
|
Edit this page
View Source
id
Declaration
Field Value
|
Edit this page
View Source
line
Declaration
private List<ParticleAlgorithm> line
Field Value
|
Edit this page
View Source
lineDir
Declaration
private Direction lineDir
Field Value
|
Edit this page
View Source
round
Declaration
Field Value
|
Edit this page
View Source
shearSuboracle
Declaration
private Shear shearSuboracle
Field Value
|
Edit this page
View Source
x
Declaration
Field Value
|
Edit this page
View Source
y
Declaration
Field Value
Methods
|
Edit this page
View Source
Init(List<Unrolling>, Direction, ParticleAlgorithm, bool, int)
Declaration
public void Init(List<Unrolling> memberParticles, Direction startDir = Direction.NONE, ParticleAlgorithm anchor = null, bool clockwise = false, int count = 0)
Parameters
|
Edit this page
View Source
OnActivate()
Virtual method that derived suboracles override to implement their subtask logic.
Called once per round by Activate().
Declaration
protected override bool OnActivate()
Returns
| Type |
Description |
| bool |
true if the subtask is complete and the suboracle should deactivate;
false if more rounds are needed.
|
Overrides
|
Edit this page
View Source
removeBonds()
Helper function to release all bonds except for the spiral structure bonds (bonds to predecessor and successor in the spiral)
Declaration
private void removeBonds()