Search Results for

    Show / Hide Table of Contents

    Class Spiral

    Implements the Spiral2LineSegment algorithm. See https://doi.org/10.4230/LIPIcs.SAND.2026.11.
    Reconfigures a spiral structure into a straight line while strictly preserving the sequence order of the amoebots.

    The algorithm achieves constant time by first converting the spiral into a y-monotone structure. It constructs a base line, safely disconnects outer segments into independent arms, and aligns them in parallel using shearing operations. The final monotone structure is then straightened using the Monotone2Line algorithm.

    Inheritance
    object
    Suboracle<Spiral>
    Spiral
    Namespace: AS2.Suboracles.Reconfiguration
    Assembly: .dll
    Syntax
    public class Spiral : Suboracle<Spiral>

    Constructors

    | Edit this page View Source

    Spiral(Particle)

    Declaration
    public Spiral(Particle rep)
    Parameters
    Type Name Description
    Particle rep

    Fields

    | Edit this page View Source

    anchor

    Declaration
    private ParticleAlgorithm anchor
    Field Value
    Type Description
    ParticleAlgorithm
    | Edit this page View Source

    anchor2

    Declaration
    private ParticleAlgorithm anchor2
    Field Value
    Type Description
    ParticleAlgorithm
    | Edit this page View Source

    arm

    Declaration
    private ParticleAttribute<bool> arm
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    baseline

    Declaration
    private ParticleAttribute<bool> baseline
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    clockwise

    Declaration
    private bool clockwise
    Field Value
    Type Description
    bool
    | Edit this page View Source

    directionExtra

    Declaration
    private ParticleAttribute<Direction> directionExtra
    Field Value
    Type Description
    ParticleAttribute<Direction>
    | Edit this page View Source

    directionIn

    Declaration
    private ParticleAttribute<Direction> directionIn
    Field Value
    Type Description
    ParticleAttribute<Direction>
    | Edit this page View Source

    directionOut

    Declaration
    private ParticleAttribute<Direction> directionOut
    Field Value
    Type Description
    ParticleAttribute<Direction>
    | Edit this page View Source

    emptyLeft

    Declaration
    private ParticleAttribute<int> emptyLeft
    Field Value
    Type Description
    ParticleAttribute<int>
    | Edit this page View Source

    emptyRight

    Declaration
    private ParticleAttribute<int> emptyRight
    Field Value
    Type Description
    ParticleAttribute<int>
    | Edit this page View Source

    hideBonds

    Declaration
    private List<ParticleAlgorithm> hideBonds
    Field Value
    Type Description
    List<ParticleAlgorithm>
    | Edit this page View Source

    id

    Declaration
    private ParticleAttribute<int> id
    Field Value
    Type Description
    ParticleAttribute<int>
    | Edit this page View Source

    leftBaseline

    Declaration
    private ParticleAttribute<bool> leftBaseline
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    leftBaselineMembers

    Declaration
    private List<ParticleAlgorithm> leftBaselineMembers
    Field Value
    Type Description
    List<ParticleAlgorithm>
    | Edit this page View Source

    leftCorners

    Declaration
    private List<Spiral> leftCorners
    Field Value
    Type Description
    List<Spiral>
    | Edit this page View Source

    monotoneToLineSuboracle

    Declaration
    private MonotoneToLine monotoneToLineSuboracle
    Field Value
    Type Description
    MonotoneToLine
    | Edit this page View Source

    parallelogramSuboracle

    Declaration
    private Parallelogram parallelogramSuboracle
    Field Value
    Type Description
    Parallelogram
    | Edit this page View Source

    releasedBonds

    Declaration
    private List<(ParticleAlgorithm, Direction, bool)> releasedBonds
    Field Value
    Type Description
    List<(ParticleAlgorithm, Direction, bool)>
    | Edit this page View Source

    releasedBonds2

    Declaration
    private List<(ParticleAlgorithm, Direction, bool)> releasedBonds2
    Field Value
    Type Description
    List<(ParticleAlgorithm, Direction, bool)>
    | Edit this page View Source

    rightBaseline

    Declaration
    private ParticleAttribute<bool> rightBaseline
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    rightBaselineMembers

    Declaration
    private List<ParticleAlgorithm> rightBaselineMembers
    Field Value
    Type Description
    List<ParticleAlgorithm>
    | Edit this page View Source

    rightCorners

    Declaration
    private List<Spiral> rightCorners
    Field Value
    Type Description
    List<Spiral>
    | Edit this page View Source

    round

    Declaration
    private ParticleAttribute<int> round
    Field Value
    Type Description
    ParticleAttribute<int>
    | Edit this page View Source

    shearSuboracle

    Declaration
    private Shear shearSuboracle
    Field Value
    Type Description
    Shear
    | Edit this page View Source

    shearSuboracleAnchors

    Declaration
    private List<Spiral> shearSuboracleAnchors
    Field Value
    Type Description
    List<Spiral>
    | Edit this page View Source

    trapezoidSuboracle

    Declaration
    private Trapezoid trapezoidSuboracle
    Field Value
    Type Description
    Trapezoid
    | Edit this page View Source

    unrollingOnly

    Declaration
    private ParticleAttribute<bool> unrollingOnly
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    unrollingSuboracle

    Declaration
    private Unrolling unrollingSuboracle
    Field Value
    Type Description
    Unrolling
    | Edit this page View Source

    xDir

    Declaration
    private Direction xDir
    Field Value
    Type Description
    Direction
    | Edit this page View Source

    yDir

    Declaration
    private Direction yDir
    Field Value
    Type Description
    Direction
    | Edit this page View Source

    zDir

    Declaration
    private Direction zDir
    Field Value
    Type Description
    Direction

    Methods

    | Edit this page View Source

    GetBorderColor(Direction, Spiral)

    Returns the color for the border in the given direction of an amoebot. Used for visualization. If the monotone-to-line suboracle is active, delegates to it. Otherwise, the color represents the spiral bonds: the border is blue for the incoming direction, red for the outgoing direction, green for additional bonds created during the transformation.

    Declaration
    public Color GetBorderColor(Direction dir, Spiral mv)
    Parameters
    Type Name Description
    Direction dir

    The direction for which the color is requested.

    Spiral mv

    The suboracle instance of the amoebot.

    Returns
    Type Description
    Color

    Blue for directionIn, red for directionOut, green for directionExtra, transparent otherwise.

    | Edit this page View Source

    Init(List<Spiral>, ParticleAlgorithm, Direction, bool)

    Initializes the suboracle for a new run. Assigns IDs to all member particles in the spiral direction with 0 in the center, sets their directionIn and directionOut attributes and determines the coordinate axes. Also checks whether extra unrolling is needed for the last x-segment to allow subsequent parallelogram moves. Fallback to only unrolling if there are less than 5 segments.

    Declaration
    public void Init(List<Spiral> memberParticles, ParticleAlgorithm outer, Direction startDir, bool clockwise)
    Parameters
    Type Name Description
    List<Spiral> memberParticles

    The particles that are part of this suboracle instance.

    ParticleAlgorithm outer

    The outermost particle of the spiral.

    Direction startDir

    The starting direction from the outermost particle towards the center.

    bool clockwise

    Whether the spiral turns clockwise.

    | Edit this page View Source

    OnActivate()

    Execute the next round of the Spiral algorithm. The method returns true when the structure has been reconfigured into a line. True if the reconfiguration is complete, false otherwise.

    Declaration
    protected override bool OnActivate()
    Returns
    Type Description
    bool
    Overrides
    Suboracle<Spiral>.OnActivate()
    | Edit this page View Source

    RemoveBonds()

    Removes all bonds from the particles in the hideBonds list, except for the bonds in the directionIn, directionOut, and directionExtra of each particle. Also handles a few special cases.

    Declaration
    private void RemoveBonds()
    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.12
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX