Search Results for

    Show / Hide Table of Contents

    Class SysPinConfiguration

    System-side implementation of the abstract base class PinConfiguration, which declares the API for the developer.

    Can generate a compressed representation to enable saving and loading pin configurations, see PinConfigurationSaveData.

    Inheritance
    object
    PinConfiguration
    SysPinConfiguration
    Namespace: AS2.Sim
    Assembly: .dll
    Syntax
    public class SysPinConfiguration : PinConfiguration

    Constructors

    | Edit this page View Source

    SysPinConfiguration(PinConfigurationSaveData, Particle)

    Recovers a pin configuration from its serializable representation. It is expected that the given particle already has an algorithm attached to it and that it matches the given pin configuration save data.

    Declaration
    public SysPinConfiguration(PinConfigurationSaveData data, Particle p)
    Parameters
    Type Name Description
    PinConfigurationSaveData data

    The serializable representation of the pin configuration.

    Particle p

    The particle to which the pin configuration should belong.

    | Edit this page View Source

    SysPinConfiguration(Particle, int, Direction)

    Declaration
    public SysPinConfiguration(Particle particle, int pinsPerEdge, Direction headDirection = Direction.NONE)
    Parameters
    Type Name Description
    Particle particle
    int pinsPerEdge
    Direction headDirection

    Fields

    | Edit this page View Source

    headDirection

    The local head direction if this pin configuration is expanded.

    Declaration
    private Direction headDirection
    Field Value
    Type Description
    Direction
    | Edit this page View Source

    isCurr

    Whether this is the current pin configuration. This is the case for the duration of one round unless a movement is performed, in which case a singleton replaces this configuration.

    Declaration
    public bool isCurr
    Field Value
    Type Description
    bool
    | Edit this page View Source

    isNext

    Whether this is the next pin configuration. This is the case during one beep activation.

    Declaration
    public bool isNext
    Field Value
    Type Description
    bool
    | Edit this page View Source

    lineRotationHead

    The global angle of the line along which partition sets are placed in the particle's head.

    Declaration
    public float lineRotationHead
    Field Value
    Type Description
    float
    | Edit this page View Source

    lineRotationTail

    The global angle of the line along which partition sets are placed in the particle's tail.

    Declaration
    public float lineRotationTail
    Field Value
    Type Description
    float
    | Edit this page View Source

    numPins

    The total number of pins.

    Declaration
    private int numPins
    Field Value
    Type Description
    int
    | Edit this page View Source

    particle

    The particle to which this pin configuration belongs.

    Declaration
    public Particle particle
    Field Value
    Type Description
    Particle
    | Edit this page View Source

    partitionSets

    The partition sets defining this pin configuration.

    Declaration
    public SysPartitionSet[] partitionSets
    Field Value
    Type Description
    SysPartitionSet[]
    | Edit this page View Source

    pins

    The pins contained in this pin configuration.

    Declaration
    public SysPin[] pins
    Field Value
    Type Description
    SysPin[]
    | Edit this page View Source

    pinsGlobal

    Pins sorted by global IDs. These are the same pins as the ones stored in pins.

    Declaration
    public SysPin[] pinsGlobal
    Field Value
    Type Description
    SysPin[]
    | Edit this page View Source

    pinsPerEdge

    The number of pins on each edge.

    Declaration
    private int pinsPerEdge
    Field Value
    Type Description
    int
    | Edit this page View Source

    placementModeHead

    The selected partition set placement mode in the particle's head.

    Declaration
    public PSPlacementMode placementModeHead
    Field Value
    Type Description
    PSPlacementMode
    | Edit this page View Source

    placementModeTail

    The selected partition set placement mode in the particle's tail.

    Declaration
    public PSPlacementMode placementModeTail
    Field Value
    Type Description
    PSPlacementMode

    Properties

    | Edit this page View Source

    HeadDirection

    The local head direction which encodes the expansion state of this pin configuration. If the state is contracted, this value is NONE.

    A pin configuration can only be applied if its expansion state matches the particle's expansion state at the end of the round.

    Declaration
    public override Direction HeadDirection { get; }
    Property Value
    Type Description
    Direction
    Overrides
    PinConfiguration.HeadDirection
    | Edit this page View Source

    NumPins

    The total number of pins in the pin configuration.

    For contracted particles, this number equals 6 * PinsPerEdge, and for expanded particles, it is 10 * PinsPerEdge.

    Declaration
    public override int NumPins { get; }
    Property Value
    Type Description
    int
    Overrides
    PinConfiguration.NumPins
    | Edit this page View Source

    PinsPerEdge

    The number of pins per edge. This number is defined as a constant by the particle algorithm.

    Declaration
    public override int PinsPerEdge { get; }
    Property Value
    Type Description
    int
    Overrides
    PinConfiguration.PinsPerEdge

    Methods

    | Edit this page View Source

    Copy()

    Creates a full copy of this pin configuration.

    All SysPins and SysPartitionSets contained in this pin configuration are copied as well. It is not a deep copy because the reference to the containing Particle stays the same.

    The isCurr and isNext flags are not copied.

    Declaration
    public SysPinConfiguration Copy()
    Returns
    Type Description
    SysPinConfiguration

    A copy of this pin configuration.

    | Edit this page View Source

    Equals(object)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)
    | Edit this page View Source

    GenerateSaveData()

    Creates a serializable object containing all data needed to restore the pin configuration.

    Declaration
    public PinConfigurationSaveData GenerateSaveData()
    Returns
    Type Description
    PinConfigurationSaveData

    A serializable representation of this pin configuration.

    | Edit this page View Source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()
    | Edit this page View Source

    GetNonEmptyPartitionSets()

    Returns all partition sets in the pin configuration that contain at least one pin.

    See also GetPartitionSets().

    Declaration
    public override PartitionSet[] GetNonEmptyPartitionSets()
    Returns
    Type Description
    PartitionSet[]

    An array containing the non-empty partition sets, ordered by their IDs. The number of returned partition sets is between 1 and NumPins.

    Overrides
    PinConfiguration.GetNonEmptyPartitionSets()
    | Edit this page View Source

    GetPartitionSet(int)

    Returns the partition set with the given ID.

    Note that the ID of a partition set does not provide any information on the partition set's content. It is merely used to identify and refer to the partition set and to provide more control over which partition sets contain which pins.

    Declaration
    public override PartitionSet GetPartitionSet(int index)
    Parameters
    Type Name Description
    int index

    The index of the partition set to get. Must be in the range 0.,,,.NumPins-1.

    Returns
    Type Description
    PartitionSet

    The partition set with the given ID index.

    Overrides
    PinConfiguration.GetPartitionSet(int)
    | Edit this page View Source

    GetPartitionSetWithId(int)

    Returns the partition set with the given ID.

    This is the system-side version of GetPartitionSet(int), which is part of the algorithm developer API.

    Declaration
    public SysPartitionSet GetPartitionSetWithId(int partitionSetId)
    Parameters
    Type Name Description
    int partitionSetId

    The ID of the partition set to return.

    Returns
    Type Description
    SysPartitionSet

    The partition set with ID partitionSetId.

    | Edit this page View Source

    GetPartitionSets()

    Returns all partition sets in the pin configuration.

    Note that the number of partition sets is always equal to NumPins since this is the maximum number of non-empty partition sets. Use GetNonEmptyPartitionSets() to get only the partition sets that contain at least one pin.

    Declaration
    public override PartitionSet[] GetPartitionSets()
    Returns
    Type Description
    PartitionSet[]

    An array of size NumPins containing all partition sets in this pin configuration. The index of a partition set in this array is its ID. Some of the partition sets may be empty.

    Overrides
    PinConfiguration.GetPartitionSets()
    | Edit this page View Source

    GetPin(int)

    Returns the pin with the given ID.

    Declaration
    public SysPin GetPin(int pinId)
    Parameters
    Type Name Description
    int pinId

    The ID of the pin to return.

    Returns
    Type Description
    SysPin

    The pin with ID pinId.

    | Edit this page View Source

    GetPinAt(Direction, int, bool)

    Returns the pin with the given offset at the given edge.

    Declaration
    public override Pin GetPinAt(Direction direction, int offset, bool head = true)
    Parameters
    Type Name Description
    Direction direction

    The direction of the edge containing the pin.

    int offset

    The pin offset on the specified edge. Must be in the range 0,...,PinsPerEdge-1.

    bool head

    If the expansion state of the pin configuration is expanded, use this flag to indicate whether the edge belongs to the particle's head or not.

    Returns
    Type Description
    Pin

    The pin in the specified location.

    Overrides
    PinConfiguration.GetPinAt(Direction, int, bool)
    | Edit this page View Source

    GetPinId(Direction, int, bool)

    Computes the ID of the pin on the specified edge with the given offset.

    The formula for the pin ID is label * pinsPerEdge + offset, where label is computed using direction and head.

    Declaration
    public int GetPinId(Direction direction, int offset, bool head = true)
    Parameters
    Type Name Description
    Direction direction

    The local direction of the edge.

    int offset

    The edge offset of the pin.

    bool head

    If the pin configuration represents the expanded state, this flag indicates whether the edge belongs to the particle's head or not.

    Returns
    Type Description
    int

    The ID of the pin in the location specified by an edge and an edge offset.

    | Edit this page View Source

    GetPinsAtEdge(Direction, bool)

    Returns all pins at the given edge.

    Declaration
    public override Pin[] GetPinsAtEdge(Direction direction, bool head = true)
    Parameters
    Type Name Description
    Direction direction

    The direction of the edge containing the pins.

    bool head

    If the expansion state of the pin configuration is expanded, use this flag to indicate whether the edge belongs to the particle's head or not.

    Returns
    Type Description
    Pin[]

    An array of size PinsPerEdge containing the pins at the specified edge, ordered by their edge offsets.

    Overrides
    PinConfiguration.GetPinsAtEdge(Direction, bool)
    | Edit this page View Source

    GetReceivedMessageOfPSet(int)

    Returns the message received by the specified partition set, if it has received a message and this pin configuration is the current one.

    Declaration
    public Message GetReceivedMessageOfPSet(int partitionSetID)
    Parameters
    Type Name Description
    int partitionSetID

    The ID of the partition set to get the message from.

    Returns
    Type Description
    Message

    A Message instance received by the partition set with ID partitionSetID, if it has received one, otherwise null.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this pin configuration is not the current one.

    | Edit this page View Source

    MakePartitionSet(Pin[], PartitionSet)

    Same as MakePartitionSet(int[], int), but the pins and the partition set are specified directly and not by their IDs. The array of pins will not be sorted.

    Declaration
    public override void MakePartitionSet(Pin[] pins, PartitionSet partitionSet)
    Parameters
    Type Name Description
    Pin[] pins

    The pins to be put into the given partition set.

    PartitionSet partitionSet
    Overrides
    PinConfiguration.MakePartitionSet(Pin[], PartitionSet)
    | Edit this page View Source

    MakePartitionSet(Pin[], int)

    Same as MakePartitionSet(int[], int), but the pins are specified directly and not by their IDs. The array will not be sorted.

    Declaration
    public override void MakePartitionSet(Pin[] pins, int partitionSetIndex)
    Parameters
    Type Name Description
    Pin[] pins

    The pins to be put into the specified partition set.

    int partitionSetIndex

    The ID of the partition set that should hold the given set of pins.

    Overrides
    PinConfiguration.MakePartitionSet(Pin[], int)
    | Edit this page View Source

    MakePartitionSet(int[], PartitionSet)

    Same as MakePartitionSet(int[], int), but the partition set is specified directly instead of by its ID.

    Declaration
    public override void MakePartitionSet(int[] pinIds, PartitionSet partitionSet)
    Parameters
    Type Name Description
    int[] pinIds

    The IDs of the pins to be put into the given partition set.

    PartitionSet partitionSet

    The partition set that should hold the specified set of pins.

    Overrides
    PinConfiguration.MakePartitionSet(int[], PartitionSet)
    | Edit this page View Source

    MakePartitionSet(int[], int)

    Sets the specified partition set to contain exactly the given pins.

    If the partition set already contains any pins that are not part of the given set, they are removed and put into their own singleton sets. If pinIds is empty, it may be impossible to put every removed pin into a singleton set, in which case an exception is thrown.

    The pinIds array will be sorted in ascending order.

    Declaration
    public override void MakePartitionSet(int[] pinIds, int partitionSetIndex)
    Parameters
    Type Name Description
    int[] pinIds

    The IDs of the pins to be put into the specified partition set.

    int partitionSetIndex

    The ID of the partition set that should hold the specified set of pins.

    Overrides
    PinConfiguration.MakePartitionSet(int[], int)
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if pinIds is empty and not all pins can be inserted into empty partition sets.

    | Edit this page View Source

    Print()

    Declaration
    public void Print()
    | Edit this page View Source

    ReceivedBeepOnPSet(int)

    Checks whether the particle has received a beep on the given partition set. Only works if this pin configuration is the current one.

    Declaration
    public bool ReceivedBeepOnPSet(int partitionSetID)
    Parameters
    Type Name Description
    int partitionSetID

    The ID of the partition set to check.

    Returns
    Type Description
    bool

    true if and only if the particle has received a beep on the partition set with ID partitionSetID and this is the current pin configuration.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this is not the current pin configuration.

    | Edit this page View Source

    ReceivedMessageOnPSet(int)

    Checks whether the particle has received a message on the given partition set. Only works if this pin configuration is the current one.

    Declaration
    public bool ReceivedMessageOnPSet(int partitionSetID)
    Parameters
    Type Name Description
    int partitionSetID

    The ID of the partition set to check.

    Returns
    Type Description
    bool

    true if and only if the particle has received a message on the partition set with ID partitionSetID and this is the current pin configuration.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this is not the current pin configuration.

    | Edit this page View Source

    ResetAllPartitionSetColors()

    Resets the color overrides of all partition sets.

    Declaration
    public override void ResetAllPartitionSetColors()
    Overrides
    PinConfiguration.ResetAllPartitionSetColors()
    | Edit this page View Source

    ResetPartitionSetColor(int)

    Resets the specified partition set's color override.

    See SetPartitionSetColor(int, Color).

    Declaration
    public override void ResetPartitionSetColor(int partitionSetIndex)
    Parameters
    Type Name Description
    int partitionSetIndex

    The ID of the partition set whose color override to reset.

    Overrides
    PinConfiguration.ResetPartitionSetColor(int)
    | Edit this page View Source

    ResetPartitionSetDrawHandle(bool)

    Resets the handle draw flags of all partition sets in the given part of the particle to false.

    Declaration
    public override void ResetPartitionSetDrawHandle(bool head = true)
    Parameters
    Type Name Description
    bool head

    Whether the flag should be reset in the particle's head or tail.

    Overrides
    PinConfiguration.ResetPartitionSetDrawHandle(bool)
    | Edit this page View Source

    ResetPartitionSetPlacement(bool)

    Resets the positions of the partition sets and sets the placement mode to NONE in the particle's head or tail.

    Declaration
    public override void ResetPartitionSetPlacement(bool head = true)
    Parameters
    Type Name Description
    bool head

    Indicates whether the partition sets should be reset in the particle's head or tail.

    Overrides
    PinConfiguration.ResetPartitionSetPlacement(bool)
    | Edit this page View Source

    SendBeepOnPSet(int)

    Sends a beep on the specified partition set, if this is the next pin configuration.

    Declaration
    public void SendBeepOnPSet(int partitionSetID)
    Parameters
    Type Name Description
    int partitionSetID

    The ID of the partition set on which to send the beep.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this pin configuration is not the next one.

    | Edit this page View Source

    SendBeepOnPin(int)

    Sends a beep on the specified pin, if this is the next pin configuration.

    Declaration
    public void SendBeepOnPin(int pinID)
    Parameters
    Type Name Description
    int pinID

    The ID of the pin on which to send the beep.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this pin configuration is not the next one.

    | Edit this page View Source

    SendMessageOnPSet(int, Message)

    Sends the given message on the specified partition set, if this pin configuration is the next one.

    Note that a copy of the given Message instance msg is sent. Altering the instance after calling this method has no effect on the sent message.

    Declaration
    public void SendMessageOnPSet(int partitionSetID, Message msg)
    Parameters
    Type Name Description
    int partitionSetID

    The ID of the partition set on which to send the message.

    Message msg

    The message to be sent.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this pin configuration is not the next one.

    | Edit this page View Source

    SendMessageOnPin(int, Message)

    Sends the given message on the specified pin, if this pin configuration is the next one.

    Note that a copy of the given Message instance msg is sent. Altering the instance after calling this method has no effect on the sent message.

    Declaration
    public void SendMessageOnPin(int pinID, Message msg)
    Parameters
    Type Name Description
    int pinID

    The ID of the pin on which to send the message.

    Message msg

    The message to be sent.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this pin configuration is not the next one.

    | Edit this page View Source

    SetLineRotation(float, bool)

    Sets the rotation of the line on which the partition sets are arranged in LINE mode. Multiples of 30 or 60 degrees will usually look best. The placement mode is changed automatically.

    Declaration
    public override void SetLineRotation(float angle, bool head = true)
    Parameters
    Type Name Description
    float angle

    The new angle of the line in degrees. 0 means vertical (perpendicular to the local E direction) and increasing angles rotate the line in local counter-clockwise direction.

    bool head

    Indicates whether the rotation for the particle's head or tail part should be set. Must be true for contracted particles.

    Overrides
    PinConfiguration.SetLineRotation(float, bool)
    | Edit this page View Source

    SetPSPlacementMode(PSPlacementMode, bool)

    Sets the partition set placement mode to the given value.

    Declaration
    public override void SetPSPlacementMode(PSPlacementMode mode, bool head = true)
    Parameters
    Type Name Description
    PSPlacementMode mode

    The new partition set placement mode.

    bool head

    Indicates whether the placement mode for the particle's head or tail will be set.

    Overrides
    PinConfiguration.SetPSPlacementMode(PSPlacementMode, bool)
    | Edit this page View Source

    SetPartitionSetColor(int, Color)

    Overrides the specified partition set's color. The circuit to which the partition set belongs will be displayed in this color unless it has been overridden by another partition set already.

    See also ResetPartitionSetColor(int).

    Declaration
    public override void SetPartitionSetColor(int partitionSetIndex, Color color)
    Parameters
    Type Name Description
    int partitionSetIndex

    The ID of the partition set whose color to override.

    Color color

    The color to set for the partition set.

    Overrides
    PinConfiguration.SetPartitionSetColor(int, Color)
    | Edit this page View Source

    SetPartitionSetDrawHandle(int, bool)

    Specifies whether the given partition set should always be drawn with a handle, even if it is a singleton set (but not if it is empty).

    Declaration
    public override void SetPartitionSetDrawHandle(int partitionSetIndex, bool drawHandle)
    Parameters
    Type Name Description
    int partitionSetIndex

    The ID of the partition set whose handle draw setting to override.

    bool drawHandle

    Whether the handle should always be drawn.

    Overrides
    PinConfiguration.SetPartitionSetDrawHandle(int, bool)
    | Edit this page View Source

    SetPartitionSetPosition(int, Vector2, bool)

    Sets the specified partition set's position in polar coordinates and sets the positioning mode of the pin configuration to MANUAL.

    Declaration
    public override void SetPartitionSetPosition(int partitionSetIndex, Vector2 polarCoords, bool head = true)
    Parameters
    Type Name Description
    int partitionSetIndex

    The ID of the partition set whose position to set.

    Vector2 polarCoords

    The polar coordinates of the partition set's position inside of the particle as (angle, distance). An angle of 0 points in local direction E and angles increase in the local counter-clockwise direction. Distance 0 is the center of the particle (part) and distance 1 is on the edge of the particle.

    bool head

    Indicates whether the position in the particle's head or tail should be set. For contracted particles, this should be true.

    Overrides
    PinConfiguration.SetPartitionSetPosition(int, Vector2, bool)
    | Edit this page View Source

    SetStarConfig(int, PartitionSet)

    Same as SetStarConfig(int, int), but the partition set is specified directly and not by its ID.

    Declaration
    public override void SetStarConfig(int offset, PartitionSet partitionSet)
    Parameters
    Type Name Description
    int offset

    The edge offset of the pins to be collected in the star partition set.

    PartitionSet partitionSet

    The partition set that should hold the star pattern.

    Overrides
    PinConfiguration.SetStarConfig(int, PartitionSet)
    | Edit this page View Source

    SetStarConfig(int, bool[], PartitionSet)

    Same as SetStarConfig(int, bool[], int), but the partition set is specified directly and not by its ID.

    Declaration
    public override void SetStarConfig(int offset, bool[] inverted, PartitionSet partitionSet)
    Parameters
    Type Name Description
    int offset

    The edge offset of the pins to be collected in the star partition set.

    bool[] inverted

    Array specifying for which edges the offset should be inverted. For any edge with a true entry, the inverted offset is computed as PinsPerEdge - 1 - offset. The array indices correspond to edge labels. The array must have length 6 for a contracted state and 10 for an expanded state.

    PartitionSet partitionSet

    The partition set that should hold the star pattern.

    Overrides
    PinConfiguration.SetStarConfig(int, bool[], PartitionSet)
    | Edit this page View Source

    SetStarConfig(int, bool[], int)

    Sets the specified partition set to contain all pins with the given edge offset offset, where the offsets of certain edges are inverted as specified by the inverted array.

    This is an extension of the basic SetStarConfig(int, int) method.

    Declaration
    public override void SetStarConfig(int offset, bool[] inverted, int partitionSetIndex)
    Parameters
    Type Name Description
    int offset

    The edge offset of the pins to be collected in the star partition set.

    bool[] inverted

    Array specifying for which edges the offset should be inverted. For any edge with a true entry, the inverted offset is computed as PinsPerEdge - 1 - offset. The array indices correspond to edge labels. The array must have length 6 for a contracted state and 10 for an expanded state.

    int partitionSetIndex

    The ID of the partition set that should hold the star pattern.

    Overrides
    PinConfiguration.SetStarConfig(int, bool[], int)
    | Edit this page View Source

    SetStarConfig(int, int)

    Sets the specified partition set to contain all pins with the given edge offset offset.

    The partition set will thus contain exactly one pin for each edge. If it already contains any pins that do not have this offset, they are removed and put into their own singleton sets.

    See also SetStarConfig(int, PartitionSet), SetStarConfig(int, bool[], int).

    Declaration
    public override void SetStarConfig(int offset, int partitionSetIndex)
    Parameters
    Type Name Description
    int offset

    The edge offset of the pins to be collected in the star partition set.

    int partitionSetIndex

    The ID of the partition set that should hold the star pattern.

    Overrides
    PinConfiguration.SetStarConfig(int, int)
    | Edit this page View Source

    SetToGlobal(PartitionSet)

    Same as SetToGlobal(int), but the partition set to hold the pins is specified directly instead of by its ID.

    Declaration
    public override void SetToGlobal(PartitionSet partitionSet)
    Parameters
    Type Name Description
    PartitionSet partitionSet

    The partition set that should hold all pins.

    Overrides
    PinConfiguration.SetToGlobal(PartitionSet)
    | Edit this page View Source

    SetToGlobal(int)

    Sets the pin configuration to the global pattern.

    In the global pattern, all pins are contained in a single partition set. If all particles in a connected system have this pin configuration, they form a global circuit on all pins simultaneously.

    Declaration
    public override void SetToGlobal(int partitionSetId = 0)
    Parameters
    Type Name Description
    int partitionSetId

    The ID of the partition set that should hold the pins.

    Overrides
    PinConfiguration.SetToGlobal(int)
    | Edit this page View Source

    SetToSingleton()

    Sets the pin configuration to the singleton pattern.

    In the singleton pattern, every pin constitutes its own partition set of size 1, i.e., there are no connections between any pins.

    Additionally, in this implementation, the pins are assigned to the partition sets such that their IDs match.

    Declaration
    public override void SetToSingleton()
    Overrides
    PinConfiguration.SetToSingleton()
    | Edit this page View Source

    TryRemovePin(int)

    Tries to remove the specified pin from its partition set and insert it into an empty partition set.

    Throws a System.InvalidOperationException if no empty partition set can be found.

    Declaration
    public void TryRemovePin(int pinId)
    Parameters
    Type Name Description
    int pinId

    The ID of the pin to be removed from its partition set.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the pin is the only one in this partition set and no other partition set is empty.

    | Edit this page View Source

    TryRemovePins(int[])

    Tries to remove the specified pins from their partition set and insert them into empty partition sets.

    It is assumed that the pins should all be removed from the same partition set.

    Throws a System.InvalidOperationException if at any point, no empty partition set can be found.

    Declaration
    public void TryRemovePins(int[] pinIds)
    Parameters
    Type Name Description
    int[] pinIds

    The IDs of the pins to be removed from their partition set. Must all be from the same partition set.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if one of the pins is the last one in the partition set and no other partition set is empty.

    | Edit this page View Source

    UpdateFlagsAfterChange()

    Resets curr flag to false because the pin configuration was altered.

    Declaration
    private void UpdateFlagsAfterChange()

    Operators

    | Edit this page View Source

    operator ==(SysPinConfiguration, SysPinConfiguration)

    Declaration
    public static bool operator ==(SysPinConfiguration pc1, SysPinConfiguration pc2)
    Parameters
    Type Name Description
    SysPinConfiguration pc1
    SysPinConfiguration pc2
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator !=(SysPinConfiguration, SysPinConfiguration)

    Declaration
    public static bool operator !=(SysPinConfiguration pc1, SysPinConfiguration pc2)
    Parameters
    Type Name Description
    SysPinConfiguration pc1
    SysPinConfiguration pc2
    Returns
    Type Description
    bool
    • 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