Class Options

java.lang.Object
org.wpilib.math.optimization.solver.Options

public class Options extends Object
Solver options.
  • Field Details

    • tolerance

      public double tolerance
      The solver will stop once the error is below this tolerance.
    • maxIterations

      public int maxIterations
      The maximum number of solver iterations before returning a solution.
    • timeout

      public double timeout
      The maximum elapsed wall clock time in seconds before returning a solution.
    • feasibleIPM

      public boolean feasibleIPM
      Enables the feasible interior-point method.

      When the inequality constraints are all feasible, step sizes are reduced when necessary to prevent them becoming infeasible again. This is useful when parts of the problem are ill-conditioned in infeasible regions (e.g., square root of a negative value). This can slow or prevent progress toward a solution though, so only enable it if necessary.

    • diagnostics

      public boolean diagnostics
      Enables diagnostic output.

      See https://sleipnirgroup.github.io/Sleipnir/md_usage.html#output for more information.

  • Constructor Details

    • Options

      public Options()
      Default options.
  • Method Details

    • withTolerance

      public Options withTolerance(double tolerance)
      Sets the tolerance.
      Parameters:
      tolerance - The solver will stop once the error is below this tolerance.
      Returns:
      This Options object.
    • withMaxIterations

      public Options withMaxIterations(int maxIterations)
      Sets the max iterations.
      Parameters:
      maxIterations - The maximum number of solver iterations before returning a solution.
      Returns:
      This Options object.
    • withTimeout

      public Options withTimeout(double timeout)
      Sets the timeout.
      Parameters:
      timeout - The maximum elapsed wall clock time in seconds before returning a solution.
      Returns:
      This Options object.
    • withFeasibleIPM

      public Options withFeasibleIPM(boolean feasibleIPM)
      Enables or disables the feasible interior-point method.

      When the inequality constraints are all feasible, step sizes are reduced when necessary to prevent them becoming infeasible again. This is useful when parts of the problem are ill-conditioned in infeasible regions (e.g., square root of a negative value). This can slow or prevent progress toward a solution though, so only enable it if necessary.

      Parameters:
      feasibleIPM - Enables or disables the feasible interior-point method.
      Returns:
      This Options object.
    • withDiagnostics

      public Options withDiagnostics(boolean diagnostics)
      Enables or disables diagnostic output.
      Parameters:
      diagnostics - Enables or disables diagnostic output.
      Returns:
      This Options object.