Search Results for

    Show / Hide Table of Contents

    Class MonotoneToLine

    Implements the Monotone2LineSegment algorithm (https://doi.org/10.4230/LIPIcs.SAND.2026.11). Reconfigures a monotone structure to a line structure in constant time.

    The suboracle is called on its representative, but stores some data in its members ParticleAttributes.

    "We call the intersection of the amoebot structure with a line parallel to the x-axis an x-section. Note that an x-section is not necessarily connected. We define y- and z-sections analogously. In particular, we also call x-sections rows, and y-sections columns. We call an amoebot structure x-monotone if and only each x-section is connected. We define y- and z-monotone analogously. We call an amoebot structure monotone if and only if it is x-monotone, y-monotone, or z-monotone."

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

    Constructors

    | Edit this page View Source

    MonotoneToLine(Particle)

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

    Fields

    | Edit this page View Source

    lineVl

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

    lineVr

    Declaration
    private ParticleAttribute<bool> lineVr
    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

    subRule12

    Declaration
    private Rule12 subRule12
    Field Value
    Type Description
    Rule12
    | Edit this page View Source

    subRule3abc

    Declaration
    private Rule3abc subRule3abc
    Field Value
    Type Description
    Rule3abc
    | Edit this page View Source

    subRule3de

    Declaration
    private Rule3de subRule3de
    Field Value
    Type Description
    Rule3de
    | 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

    ColumnsCounts(ParticleAlgorithm[][])

    Calculates the number of amoebots per column.

    Declaration
    private static int[] ColumnsCounts(ParticleAlgorithm[][] grid)
    Parameters
    Type Name Description
    ParticleAlgorithm[][] grid

    The particle grid

    Returns
    Type Description
    int[]

    An array with the number of amoebots in each column

    | Edit this page View Source

    GetBorderColor(Direction, MonotoneToLine)

    Returns the color for the border in the given direction of an amoebot. Used for visualization. The border is green if the corresponding line bond is active, and transparent otherwise.

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

    The direction for which the color is requested

    MonotoneToLine mv

    The suboracle instance of the amoebot.

    Returns
    Type Description
    Color

    Green if there is a bond

    | Edit this page View Source

    Init(List<MonotoneToLine>, Direction, Direction, Direction)

    Initializes the suboracle for a new run. It is assumed that the structure is y-monotone according to the given yDir.

    Declaration
    public void Init(List<MonotoneToLine> memberParticles, Direction xDir, Direction yDir, Direction zDir)
    Parameters
    Type Name Description
    List<MonotoneToLine> memberParticles

    The particles that are part of this suboracle instance.

    Direction xDir

    The direction of the x-axis.

    Direction yDir

    The direction of the y-axis.

    Direction zDir

    The direction of the z-axis.

    | Edit this page View Source

    OnActivate()

    Execute the next round of the MonotoneToLine algorithm. Round 0: Initializes the line bonds and handles a special shift case. Round 1: Contracts particles after the shift. Round 2: Applies the reconfiguration rules (1, 2, 3a-e) to each column. Round 3: Waits for the sub-rules to complete and cleans up. The method returns true when the structure has been reconfigured into a line.

    Declaration
    protected override bool OnActivate()
    Returns
    Type Description
    bool

    True if the reconfiguration is complete, false otherwise.

    Overrides
    Suboracle<MonotoneToLine>.OnActivate()
    • 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