Class State<S,O>

java.lang.Object
net.automatalib.automaton.mmlt.State<S,O>
Type Parameters:
S - location type
O - output symbol type

public final class State<S,O> extends Object
A state configuration of an MMLT. A configuration is a tuple of an active location and the valuation of its timers.
  • Constructor Details

    • State

      public State(S location, List<TimerInfo<S,O>> sortedTimers)
      Initializes the entry configuration for the provided location, where all timers have their initial value.
      Parameters:
      location - the location
      sortedTimers - the timers of the location, sorted by initial value
  • Method Details

    • getLocation

      public S getLocation()
      Returns the MMLT location of this state.
      Returns:
      the location
    • getEntryDistance

      public long getEntryDistance()
      Returns the entry distance. This is the minimal number of time steps required to reach this configuration from the entry configuration.
      Returns:
      the entry distance
    • isEntryConfig

      public boolean isEntryConfig()
      Indicates if this is the entry configuration of the location. A configuration is the entry configuration if all timers have their initial value.
      Returns:
      true if this is the entry configuration, false otherwise
    • isStableConfig

      public boolean isStableConfig()
      Indicates if this configuration is stable. A configuration is stable if its entry distance is less than the initial value of the timer with the lowest initial value of the location. If the location has no timers, its only configuration is its entry configuration, which is always stable.
      Returns:
      true if stable, false otherwise
    • resetTimers

      public State<S,O> resetTimers()
      Returns a copy of this state with all timers reset to their initial values.
      Returns:
      the new state with all its timers reset
    • getNextExpiringTimers

      public @Nullable TimeoutPair<S,O> getNextExpiringTimers()
      Returns all timers that time out in the least number of time steps.
      Returns:
      the timed out timers
    • decrement

      public State<S,O> decrement(long delay)
      Returns a new state in which all timer values have been decreased by the specified amount. This amount must be at most the time to the next timeout. If this sets a timer to zero, this timer is immediately reset to its initial value.
      Parameters:
      delay - the value by which to decrement the current timers
      Returns:
      the new state with updated timers
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object