Class EditorSettings

java.lang.Object
it.univr.di.cstnu.gui.EditorSettings

public final class EditorSettings extends Object
Mutable container of the options that govern how EditorController runs its checking commands. Every option that used to be a scattered field or a hard-coded constant in the old editor (the old JUNG-based one) lives here, and only here.

In particular, the old editor used two different, inconsistent check timeouts: 1800 seconds (CHECK_TIMEOUT_S, used by most CSTNU-family checks) and 2700 seconds (hard-coded in oneStepCSTNU). This class exposes a single getCheckTimeoutSeconds(), defaulting to DEFAULT_CHECK_TIMEOUT_S, used by every command that needs a timeout.

Author:
posenato
  • Field Details

    • DEFAULT_CHECK_TIMEOUT_S

      public static final int DEFAULT_CHECK_TIMEOUT_S
      Default check timeout, in seconds: 1800 (30 minutes).
      See Also:
  • Constructor Details

    • EditorSettings

      public EditorSettings()
  • Method Details

    • getStnAlgorithm

      @Nonnull public STN.CheckAlgorithm getStnAlgorithm()
      Returns:
      the checking algorithm for STN commands
    • setStnAlgorithm

      public void setStnAlgorithm(@Nonnull STN.CheckAlgorithm stnAlgorithm1)
      Parameters:
      stnAlgorithm1 - the checking algorithm for STN commands
    • getStnuAlgorithm

      @Nonnull public STNU.CheckAlgorithm getStnuAlgorithm()
      Returns:
      the checking algorithm for STNU commands
    • setStnuAlgorithm

      public void setStnuAlgorithm(@Nonnull STNU.CheckAlgorithm stnuAlgorithm1)
      Parameters:
      stnuAlgorithm1 - the checking algorithm for STNU commands
    • getCstnAlgorithm

      @Nonnull public AbstractCSTN.CheckAlgorithm getCstnAlgorithm()
      Returns:
      the checking algorithm for CSTN commands
    • setCstnAlgorithm

      public void setCstnAlgorithm(@Nonnull AbstractCSTN.CheckAlgorithm cstnAlgorithm1)
      Parameters:
      cstnAlgorithm1 - the checking algorithm for CSTN commands
    • getDcSemantics

      @Nonnull public AbstractCSTN.DCSemantics getDcSemantics()
      Returns:
      the dynamic-consistency semantics for CSTN commands
    • setDcSemantics

      public void setDcSemantics(@Nonnull AbstractCSTN.DCSemantics dcSemantics1)
      Parameters:
      dcSemantics1 - the dynamic-consistency semantics for CSTN commands
    • getReactionTime

      public int getReactionTime()
      Returns:
      the reaction time used under ε semantics
    • setReactionTime

      public void setReactionTime(int reactionTime1)
      Parameters:
      reactionTime1 - the reaction time used under ε semantics
      Throws:
      IllegalArgumentException - if reactionTime1 is less than 1
    • isPropagateOnlyToZ

      public boolean isPropagateOnlyToZ()
      Returns:
      whether dynamic-controllability checks must propagate constraints only towards the zero time-point
    • setPropagateOnlyToZ

      public void setPropagateOnlyToZ(boolean propagateOnlyToZ1)
      Parameters:
      propagateOnlyToZ1 - whether dynamic-controllability checks must propagate constraints only towards the zero time-point
    • isContingentAlsoAsOrdinary

      public boolean isContingentAlsoAsOrdinary()
      Returns:
      whether a contingent link must also be represented as an ordinary constraint
    • setContingentAlsoAsOrdinary

      public void setContingentAlsoAsOrdinary(boolean contingentAlsoAsOrdinary1)
      Parameters:
      contingentAlsoAsOrdinary1 - whether a contingent link must also be represented as an ordinary constraint
    • getCheckTimeoutSeconds

      public int getCheckTimeoutSeconds()
      Returns:
      the check timeout, in seconds
    • setCheckTimeoutSeconds

      public void setCheckTimeoutSeconds(int checkTimeoutSeconds1)
      Parameters:
      checkTimeoutSeconds1 - the check timeout, in seconds
      Throws:
      IllegalArgumentException - if checkTimeoutSeconds is not positive