Search Results for

    Show / Hide Table of Contents

    Class SpiralTestInitializer

    Inheritance
    object
    InitializationMethod
    SpiralTestInitializer
    Namespace: AS2.Algos.SuboracleTest
    Assembly: .dll
    Syntax
    public class SpiralTestInitializer : InitializationMethod

    Constructors

    | Edit this page View Source

    SpiralTestInitializer(ParticleSystem)

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

    Methods

    | Edit this page View Source

    DrawSpiralFromString(Vector2Int, Direction, bool, string)

    Generates a spiral of positions from a comma-separated string of segment lengths. Each number represents the length of a segment; after each segment the direction rotates by 60°. Segments of length 1 will cause an acute angle turn.

    Declaration
    private (Direction, List<Vector2Int>) DrawSpiralFromString(Vector2Int startPos, Direction mainDir, bool clockwise, string segmentLengths)
    Parameters
    Type Name Description
    Vector2Int startPos

    The starting position of the spiral.

    Direction mainDir

    The initial direction of the spiral.

    bool clockwise

    Whether the spiral winds clockwise.

    string segmentLengths

    A comma-separated string of segment lengths.

    Returns
    Type Description
    (Direction, List<Vector2Int>)

    A tuple containing the final direction and the list of generated positions.

    | Edit this page View Source

    Generate(CardinalDirection, int, bool, float, string)

    Declaration
    public void Generate(SpiralTestInitializer.CardinalDirection startDir = CardinalDirection.NNE, int numParticles = 100, bool clockwise = true, float turnProb = 0.35, string segmentLengths = "2,2,2,3,4,2,8,2,8,3,9,4,8,5,9,4,11,6,8,2")
    Parameters
    Type Name Description
    SpiralTestInitializer.CardinalDirection startDir
    int numParticles
    bool clockwise
    float turnProb
    string segmentLengths
    | Edit this page View Source

    GenerateSpiralPositions(Vector2Int, Direction, int, bool, float, bool)

    Generates a spiral of positions using random walk with turning probability.

    Declaration
    private (Direction, List<Vector2Int>) GenerateSpiralPositions(Vector2Int startPos, Direction mainDir, int numPositions, bool clockwise, float turnProb, bool allowAcute)
    Parameters
    Type Name Description
    Vector2Int startPos

    The starting position of the spiral.

    Direction mainDir

    The initial direction of the spiral, starting in the center.

    int numPositions

    The number of particle positions to generate.

    bool clockwise

    Whether the spiral winds clockwise.

    float turnProb

    The probability of turning at each step.

    bool allowAcute

    Whether acute angle turns are allowed.

    Returns
    Type Description
    (Direction, List<Vector2Int>)

    A tuple containing the final direction and the list of generated positions.

    • 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