Search Results for

    Show / Hide Table of Contents

    Class ValueHistoryPinConfiguration

    Specialized value history that stores compressed pin configuration data.

    Each pin configuration is only stored once to save memory. The history itself simply stores identifiers instead of whole pin configurations.

    Inheritance
    object
    ValueHistory<SysPinConfiguration>
    ValueHistoryPinConfiguration
    Implements
    IReplayHistory
    Namespace: AS2.Sim
    Assembly: .dll
    Syntax
    public class ValueHistoryPinConfiguration : ValueHistory<SysPinConfiguration>, IReplayHistory

    Constructors

    | Edit this page View Source

    ValueHistoryPinConfiguration(PinConfigurationHistorySaveData)

    Same as ValueHistory(ValueHistorySaveData<T>) but specialized for pin configuration history data.

    Declaration
    public ValueHistoryPinConfiguration(PinConfigurationHistorySaveData data)
    Parameters
    Type Name Description
    PinConfigurationHistorySaveData data

    The serializable history data from which to restore the ValueHistoryPinConfiguration instance.

    | Edit this page View Source

    ValueHistoryPinConfiguration(SysPinConfiguration, int)

    Declaration
    public ValueHistoryPinConfiguration(SysPinConfiguration initialValue, int initialRound = 0)
    Parameters
    Type Name Description
    SysPinConfiguration initialValue
    int initialRound

    Fields

    | Edit this page View Source

    configs

    Contains all pin configurations we have seen so far. Pin configurations are only stored once to save memory.

    Declaration
    private List<PinConfigurationSaveData> configs
    Field Value
    Type Description
    List<PinConfigurationSaveData>
    | Edit this page View Source

    idxHistory

    Stores the actual history state and indices of pin configurations.

    Declaration
    private ValueHistory<int> idxHistory
    Field Value
    Type Description
    ValueHistory<int>

    Methods

    | Edit this page View Source

    ContinueTracking()

    Resets the marker to continue tracking the last recorded round.

    Declaration
    public override void ContinueTracking()
    Overrides
    ValueHistory<SysPinConfiguration>.ContinueTracking()
    | Edit this page View Source

    CutOffAfterRound(int)

    Deletes all records after the specified round, turning this round into the last round if it is earlier than the current last round.

    Declaration
    public override void CutOffAfterRound(int round)
    Parameters
    Type Name Description
    int round

    The round after which all records should be removed.

    Overrides
    ValueHistory<SysPinConfiguration>.CutOffAfterRound(int)
    | Edit this page View Source

    CutOffAtMarker()

    Deletes all records after the currently marked round. If the marked round is earlier than the current last round, the marked round becomes the new last round.

    Declaration
    public override void CutOffAtMarker()
    Overrides
    ValueHistory<SysPinConfiguration>.CutOffAtMarker()
    | Edit this page View Source

    FindOrAddConfig(PinConfigurationSaveData)

    Helper to find a given pin configuration in the list of encountered configurations or insert it and then return its index.

    Declaration
    private int FindOrAddConfig(PinConfigurationSaveData d)
    Parameters
    Type Name Description
    PinConfigurationSaveData d

    The compressed version of the pin configuration to find or insert.

    Returns
    Type Description
    int

    The index of d in the list of encountered pin configurations.

    | Edit this page View Source

    GeneratePCSaveData()

    Generates value history save data specifically for serialized pin configuration data. Use this instead of GenerateSaveData().

    Declaration
    public PinConfigurationHistorySaveData GeneratePCSaveData()
    Returns
    Type Description
    PinConfigurationHistorySaveData

    A serializable object storing history data from which pin configurations can be restored.

    | Edit this page View Source

    GenerateSaveData()

    Not supported.

    Declaration
    public override ValueHistorySaveData<SysPinConfiguration> GenerateSaveData()
    Returns
    Type Description
    ValueHistorySaveData<SysPinConfiguration>
    Overrides
    ValueHistory<SysPinConfiguration>.GenerateSaveData()
    | Edit this page View Source

    GetFirstRecordedRound()

    Returns the first round in which a value was recorded. This is the round in which the history of this variable begins; its value is undefined in all previous rounds.

    See also GetLastRecordedRound().

    Declaration
    public override int GetFirstRecordedRound()
    Returns
    Type Description
    int

    The first round with a recorded value.

    Overrides
    ValueHistory<SysPinConfiguration>.GetFirstRecordedRound()
    | Edit this page View Source

    GetLastRecordedRound()

    Returns the last round in which a value was recorded. The history may only be updated for rounds greater than or equal to this round. Queries for rounds after this one will return the value that was recorded for this round.

    See also GetFirstRecordedRound().

    Declaration
    public override int GetLastRecordedRound()
    Returns
    Type Description
    int

    The last round with a recorded value.

    Overrides
    ValueHistory<SysPinConfiguration>.GetLastRecordedRound()
    | Edit this page View Source

    GetMarkedRound()

    Returns the round that is currently marked.

    See SetMarkerToRound(int), StepBack(), StepForward().

    Declaration
    public override int GetMarkedRound()
    Returns
    Type Description
    int

    The currently marked round.

    Overrides
    ValueHistory<SysPinConfiguration>.GetMarkedRound()
    | Edit this page View Source

    GetMarkedValue()

    Not supported, use GetMarkedValue(Particle) instead.

    A Particle is required to reconstruct a SysPinConfiguration from only its PinConfigurationSaveData.

    Declaration
    public override SysPinConfiguration GetMarkedValue()
    Returns
    Type Description
    SysPinConfiguration
    Overrides
    ValueHistory<SysPinConfiguration>.GetMarkedValue()
    | Edit this page View Source

    GetMarkedValue(Particle)

    Replaces GetMarkedValue().

    A Particle is required to reconstruct a SysPinConfiguration from its PinConfigurationSaveData.

    Declaration
    public SysPinConfiguration GetMarkedValue(Particle p)
    Parameters
    Type Name Description
    Particle p

    The particle used to reconstruct the pin configuration. Must be in a matching expansion state.

    Returns
    Type Description
    SysPinConfiguration

    A pin configuration reconstructed from the currently marked configuration data using the particle p.

    | Edit this page View Source

    GetValueInRound(int)

    Not supported, use GetValueInRound(int, Particle) instead.

    A Particle is required to reconstruct a SysPinConfiguration from only its PinConfigurationSaveData.

    Declaration
    public override SysPinConfiguration GetValueInRound(int round)
    Parameters
    Type Name Description
    int round
    Returns
    Type Description
    SysPinConfiguration
    Overrides
    ValueHistory<SysPinConfiguration>.GetValueInRound(int)
    | Edit this page View Source

    GetValueInRound(int, Particle)

    Replaces GetValueInRound(int).

    A Particle is required to reconstruct a SysPinConfiguration from its PinConfigurationSaveData.

    Declaration
    public SysPinConfiguration GetValueInRound(int round, Particle p)
    Parameters
    Type Name Description
    int round

    The round from which to get the pin configuration.

    Particle p

    The particle used to reconstruct the pin configuration. Must be in a matching expansion state.

    Returns
    Type Description
    SysPinConfiguration

    A pin configuration reconstructed from the configuration data recorded for round round, using the particle p.

    | Edit this page View Source

    IsTracking()

    Checks whether the round marker is currently tracking the latest round.

    Declaration
    public override bool IsTracking()
    Returns
    Type Description
    bool

    true if and only if the marker is tracking the latest round.

    Overrides
    ValueHistory<SysPinConfiguration>.IsTracking()
    | Edit this page View Source

    RecordValueAtMarker(SysPinConfiguration)

    Like RecordValueInRound(T, int) but the recorded round is the round that is currently marked.

    Declaration
    public override void RecordValueAtMarker(SysPinConfiguration value)
    Parameters
    Type Name Description
    SysPinConfiguration value

    The value to record in the currently marked round.

    Overrides
    ValueHistory<SysPinConfiguration>.RecordValueAtMarker(SysPinConfiguration)
    | Edit this page View Source

    RecordValueInRound(SysPinConfiguration, int)

    Adds a value for the specified round to the variable record.

    The value is assumed to remain unchanged between the previously last round and round.

    Declaration
    public override void RecordValueInRound(SysPinConfiguration value, int round)
    Parameters
    Type Name Description
    SysPinConfiguration value

    The value to be recorded.

    int round

    The round for which the value should be recorded. Must be greater than or equal to the last recorded round.

    Overrides
    ValueHistory<SysPinConfiguration>.RecordValueInRound(SysPinConfiguration, int)
    | Edit this page View Source

    SetMarkerToRound(int)

    Sets the marker to the specified round and stops it from tracking the latest round.

    Declaration
    public override void SetMarkerToRound(int round)
    Parameters
    Type Name Description
    int round

    The round to which the marker should be set. Must not be smaller than the first recorded round.

    Overrides
    ValueHistory<SysPinConfiguration>.SetMarkerToRound(int)
    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if round is less than the first recorded round.

    | Edit this page View Source

    ShiftTimescale(int)

    Shifts all records as well as the marker by the specified amount of rounds.

    Declaration
    public override void ShiftTimescale(int amount)
    Parameters
    Type Name Description
    int amount

    The number of rounds to add to each entry. May be negative.

    Overrides
    ValueHistory<SysPinConfiguration>.ShiftTimescale(int)
    | Edit this page View Source

    StepBack()

    Moves the marker one round back and stops it from tracking the last round.

    Must not be called when the marker is already at the first recorded round.

    Declaration
    public override void StepBack()
    Overrides
    ValueHistory<SysPinConfiguration>.StepBack()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the marker is already at the first recorded round.

    | Edit this page View Source

    StepForward()

    Moves the marker one round forward and stops it from tracking the last round.

    Declaration
    public override void StepForward()
    Overrides
    ValueHistory<SysPinConfiguration>.StepForward()

    Operators

    | Edit this page View Source

    implicit operator SysPinConfiguration(ValueHistoryPinConfiguration)

    Implicit conversion that returns the currently marked value

    Declaration
    public static implicit operator SysPinConfiguration(ValueHistoryPinConfiguration history)
    Parameters
    Type Name Description
    ValueHistoryPinConfiguration history

    The history whose marked value to return.

    Returns
    Type Description
    SysPinConfiguration

    Implements

    IReplayHistory
    • 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