Search Results for

    Show / Hide Table of Contents

    Class SpiralTest

    Simple algorithm to test the Spiral suboracle. Transforms a spiral structure into a line in constant time (https://doi.org/10.4230/LIPIcs.SAND.2026.11).

    All particles in the spiral formation are marked as members. The root particle at the spiral's outer end manages the state and coordinates the spiral formation.

    Inheritance
    object
    ParticleAlgorithm
    SpiralTest
    Namespace: AS2.Algos.SuboracleTest
    Assembly: .dll
    Syntax
    public class SpiralTest : ParticleAlgorithm

    Constructors

    | Edit this page View Source

    SpiralTest(Particle)

    Declaration
    public SpiralTest(Particle p)
    Parameters
    Type Name Description
    Particle p

    Fields

    | Edit this page View Source

    clockwise

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

    dir

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

    isRoot

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

    member

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

    round

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

    spiralSuboracle

    Declaration
    private Spiral spiralSuboracle
    Field Value
    Type Description
    Spiral

    Properties

    | Edit this page View Source

    GenerationMethod

    Declaration
    public static string GenerationMethod { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Name

    Declaration
    public static string Name { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    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
    ParticleAlgorithm.PinsPerEdge

    Methods

    | Edit this page View Source

    ActivateBeep()

    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
    ParticleAlgorithm.ActivateBeep()
    | Edit this page View Source

    ActivateMove()

    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()
    Overrides
    ParticleAlgorithm.ActivateMove()
    | Edit this page View Source

    BorderColors(ParticleSystem, Particle)

    Colors the borders of particles for visualization. The spiral suboracle determines the border color for each member particle.

    Declaration
    [StatusInfo("BorderColors", "Color the borders", false)]
    public static void BorderColors(ParticleSystem system, Particle selectedParticle)
    Parameters
    Type Name Description
    ParticleSystem system

    The particle system.

    Particle selectedParticle

    The currently selected particle (unused).

    | Edit this page View Source

    Init(bool, Direction, bool, bool)

    Initializes the particle with the given spiral parameters.

    Declaration
    public void Init(bool isRoot, Direction dir, bool clockwise, bool member)
    Parameters
    Type Name Description
    bool isRoot

    Whether this particle is the root of the spiral.

    Direction dir

    The direction from the root toward the spiral.

    bool clockwise

    Whether the spiral winds clockwise.

    bool member

    Whether this particle is a member of the spiral.

    | Edit this page View Source

    IsFinished()

    Checks whether this particle has finished its algorithm.

    Override this method to return true when a particle is done executing the algorithm. Once all particles in the system are finished, the simulation will stop automatically. When a particle's state results in this method returning true, its activation methods should not change its state any more.

    Declaration
    public override bool IsFinished()
    Returns
    Type Description
    bool

    true if and only if this particle has finished its algorithm.

    Overrides
    ParticleAlgorithm.IsFinished()
    | Edit this page View Source

    Oracle(ParticleSystem)

    Executes the oracle rounds for the spiral test. Round 0: Collects members, initializes and activates the spiral suboracle. Round 1: Continues activating the spiral suboracle until it finishes.

    Declaration
    public static bool Oracle(ParticleSystem system)
    Parameters
    Type Name Description
    ParticleSystem system

    The particle system.

    Returns
    Type Description
    bool

    True if the reconfiguration is complete, false otherwise.

    • 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