Search Results for

    Show / Hide Table of Contents

    Class BinOpUtils

    General helper methods for binary operations on amoebot chains.

    Inheritance
    object
    BinOpUtils
    Namespace: AS2.Subroutines.BinaryOps
    Assembly: .dll
    Syntax
    public static class BinOpUtils

    Methods

    | Edit this page View Source

    GetChainPSetID(PinConfiguration, Direction, Direction, int, int)

    Helper for getting the partition set IDs of connected chain circuits. This is useful at the start and end of the chain, where one of the two ends is not connected, so we cannot easily use the pin to find the partition set.

    Declaration
    public static int GetChainPSetID(PinConfiguration pc, Direction predDir, Direction succDir, int offset, int pinsPerEdge)
    Parameters
    Type Name Description
    PinConfiguration pc

    The pin configuration from which to get the partition set IDs.

    Direction predDir

    The direction of the predecessor. NONE means there is no predecessor.

    Direction succDir

    The direction of the chain successor. NONE means there is no successor.

    int offset

    The pin distance of the connections. The offset is applied to the predecessor pin and inverted for the successor.

    int pinsPerEdge

    The number of pins per edge used by the algorithm.

    Returns
    Type Description
    int

    The ID of the chain circuit connecting the predecessor and successor at the given offset. -1 if there is neither a predecessor nor a successor.

    | Edit this page View Source

    MakeChainCircuit(PinConfiguration, Direction, Direction, int, int, bool)

    Sets up a chain circuit by connecting or disconnecting the predecessor from the successor at the given pin offset. If partition sets are created, their IDs will always be one of the contained pin IDs.

    Declaration
    public static void MakeChainCircuit(PinConfiguration pc, Direction predDir, Direction succDir, int offset, int pinsPerEdge, bool connected)
    Parameters
    Type Name Description
    PinConfiguration pc

    The pin configuration to be modified.

    Direction predDir

    The direction of the chain predecessor. NONE means there is no predecessor.

    Direction succDir

    The direction of the chain successor. NONE means there is no successor.

    int offset

    The pin distance of the connections. The offset is applied to the predecessor pin and inverted for the successor.

    int pinsPerEdge

    The number of pins per edge used by the algorithm.

    bool connected

    Whether the pins of the predecessor and successor should be connected. There will be no connection if the predecessor or successor direction is NONE.

    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX