Search Results for

    Show / Hide Table of Contents

    Class UniversalReconfigurationInitializer

    Initialization method for the Universal Reconfiguration algorithm. Generates a random connected structure with holes and allows starting from any phase.

    Inheritance
    object
    InitializationMethod
    UniversalReconfigurationInitializer
    Namespace: AS2.Algos.Reconfiguration
    Assembly: .dll
    Syntax
    public class UniversalReconfigurationInitializer : InitializationMethod

    Constructors

    | Edit this page View Source

    UniversalReconfigurationInitializer(ParticleSystem)

    Declaration
    public UniversalReconfigurationInitializer(ParticleSystem system)
    Parameters
    Type Name Description
    ParticleSystem system

    Methods

    | Edit this page View Source

    Generate(int, float, StartState, bool)

    Generates a random configuration with the specified number of particles according to the given starting state, then sets the starting phase on the root particle.

    • ARBITRARY: random structure with holes (default).
    • BOUNDED: random structure where every row has at least ⌈√n⌉ particles.
    • MONOTONE: y-monotone structure.
    • HISTOGRAM: y-monotone structure with all columns starting at y=0.
    Declaration
    public void Generate(int numParticles = 42, float holeProb = 0.3, UniversalReconfigurationInitializer.StartState startState = StartState.ARBITRARY, bool markAllConflictsToBound = false)
    Parameters
    Type Name Description
    int numParticles

    Number of particles to generate (default: 25).

    float holeProb

    Probability of a hole at each lattice position (default: 0.3). Only used when startState is ARBITRARY.

    UniversalReconfigurationInitializer.StartState startState

    The state to start the algorithm in (default: ARBITRARY).

    bool markAllConflictsToBound

    If true, all conflicts in the first phase are marked yellow.

    | Edit this page View Source

    GenerateBounded(int, float, Chirality, Compass)

    Generates a random connected structure where every non-empty row has at least ⌈√n⌉ particles (the "bounded" condition). First generates a random structure with holes, then iteratively merges rows that are too small into adjacent rows. When both rows have a particle in the same column, one is randomly moved to extend the target row (append/prepend).

    Declaration
    private void GenerateBounded(int numParticles, float holeProb, Initialization.Chirality chirality, Initialization.Compass compassDir)
    Parameters
    Type Name Description
    int numParticles

    The number of particles to place.

    float holeProb

    Probability of leaving a position empty (hole).

    Initialization.Chirality chirality

    The chirality setting for all particles.

    Initialization.Compass compassDir

    The compass setting for all particles.

    | Edit this page View Source

    GenerateYMonotone(int, Chirality, Compass, bool)

    Generates a y-monotone structure with the given number of particles. A y-monotone structure consists of columns of particles stacked contiguously (no gaps within a column). Columns are built left to right, each with a random height and a starting y-level chosen to guarantee connectivity with the previous column.

    Declaration
    private void GenerateYMonotone(int numParticles, Initialization.Chirality chirality, Initialization.Compass compassDir, bool histogram = false)
    Parameters
    Type Name Description
    int numParticles

    The number of particles to place.

    Initialization.Chirality chirality

    The chirality setting for all particles.

    Initialization.Compass compassDir

    The compass setting for all particles.

    bool histogram

    If true, all columns start at y=0 (for a histogram structures).

    • 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