Search Results for

    Show / Hide Table of Contents

    Class ParticleAttributeWithHistory<T>

    Abstract base class for particle attributes that adds functionality which should be hidden from the algorithm developer, especially the history methods.

    Inheritance
    object
    ParticleAttributeBase
    ParticleAttribute<T>
    ParticleAttributeWithHistory<T>
    ParticleAttribute_Bool
    ParticleAttribute_Direction
    ParticleAttribute_Enum<T>
    ParticleAttribute_Float
    ParticleAttribute_Int
    ParticleAttribute_PinConfiguration
    ParticleAttribute_String
    Implements
    IReplayHistory
    Namespace: AS2.Sim
    Assembly: .dll
    Syntax
    public abstract class ParticleAttributeWithHistory<T> : ParticleAttribute<T>, IReplayHistory
    Type Parameters
    Name Description
    T

    The type of values the attribute stores.

    Constructors

    | Edit this page View Source

    ParticleAttributeWithHistory(Particle, string)

    Declaration
    public ParticleAttributeWithHistory(Particle p, string name)
    Parameters
    Type Name Description
    Particle p
    string name

    Fields

    | Edit this page View Source

    hasIntermediateVal

    Flag that indicates whether the intermediate value has been written. Will be reset after each round.

    Declaration
    protected bool hasIntermediateVal
    Field Value
    Type Description
    bool
    | Edit this page View Source

    history

    The history of values recorded by this attribute.

    Declaration
    protected ValueHistory<T> history
    Field Value
    Type Description
    ValueHistory<T>
    | Edit this page View Source

    intermediateVal

    The value written to the attribute in the move activation phase. This value is not stored in the internal history. It is written during the move phase and serves as previous value during the beep phase.

    Declaration
    protected T intermediateVal
    Field Value
    Type Description
    T

    Methods

    | Edit this page View Source

    ContinueTracking()

    Resets the marker to track the latest recorded state and to continue evolving as the simulation progresses.

    Declaration
    public virtual void ContinueTracking()
    | Edit this page View Source

    CutOffAtMarker()

    Deletes all recorded states after the currently marked round.

    Declaration
    public virtual void CutOffAtMarker()
    | Edit this page View Source

    GenerateSaveData()

    Implementation of GenerateSaveData().

    Declaration
    public virtual ParticleAttributeSaveDataBase GenerateSaveData()
    Returns
    Type Description
    ParticleAttributeSaveDataBase

    A serializable representation of the attribute's state.

    | Edit this page View Source

    GetAttributeType()

    Declaration
    public virtual Type GetAttributeType()
    Returns
    Type Description
    Type
    | Edit this page View Source

    GetFirstRecordedRound()

    Returns the first round for which a state has been recorded.

    The object cannot be reset to a time before this round.

    Declaration
    public virtual int GetFirstRecordedRound()
    Returns
    Type Description
    int

    The first round for which a state has been recorded.

    | Edit this page View Source

    GetMarkedRound()

    Returns the round that is currently marked.

    If the marker is tracking the object's state, this round will increase every time a new value is recorded.

    Declaration
    public virtual int GetMarkedRound()
    Returns
    Type Description
    int

    The round that is currently marked.

    | Edit this page View Source

    GetObjectValue()

    Declaration
    public virtual object GetObjectValue()
    Returns
    Type Description
    object
    | Edit this page View Source

    IsTracking()

    Checks whether the object is currently tracking the latest recorded state.

    If the object is not tracking, it may not be usable in the regular way until the tracking is continued.

    Declaration
    public virtual bool IsTracking()
    Returns
    Type Description
    bool

    Whether the marker currently tracks the latest recorded state.

    | Edit this page View Source

    ResetIntermediateValue()

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

    RestoreFromSaveData(ParticleAttributeSaveDataBase)

    Implementation of RestoreFromSaveData(ParticleAttributeSaveDataBase).

    Declaration
    public virtual bool RestoreFromSaveData(ParticleAttributeSaveDataBase data)
    Parameters
    Type Name Description
    ParticleAttributeSaveDataBase data

    A serializable representation of a particle attribute state.

    Returns
    Type Description
    bool

    true if and only if the state update was successful.

    | Edit this page View Source

    SetMarkerToRound(int)

    Sets the tracking marker to the specified round, restores the state recorded for that point in time, and stops the marker from tracking the latest round.

    The target round must not be earlier than the round returned by GetFirstRecordedRound().

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

    The round to which the tracking marker should be set.

    | Edit this page View Source

    ShiftTimescale(int)

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

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

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

    | Edit this page View Source

    StepBack()

    Moves the marker one round back and restores the object's recorded state for that round. Also stops it from tracking the last round if it was still tracking.

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

    Declaration
    public virtual void StepBack()
    | Edit this page View Source

    StepForward()

    Moves the marker one round forward and restores the object's recorded state for that round. Also stops it from tracking the last round if it was still tracking.

    May be ineffective if the object has a hard limit on the last recorded round.

    Declaration
    public virtual void StepForward()
    | Edit this page View Source

    ToString_AttributeName()

    Declaration
    public virtual string ToString_AttributeName()
    Returns
    Type Description
    string

    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