Class SolverOptions
-
- All Implemented Interfaces:
public class SolverOptions
Configuration options for queueing network solvers.
This class contains all configurable parameters that control solver behavior, including convergence criteria, numerical tolerances, algorithmic choices, and output preferences. Options can be customized per solver type or globally across all solvers.
Many options are solver-specific and may be ignored by solvers that don't support them. The class provides builder-style setter methods for convenient configuration chaining.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
SolverOptions.Config
Advanced configuration options for specialized solver features. These options control solver-specific behavior and may not be applicable to all solver types.
public class
SolverOptions.ODESolvers
Configuration for ordinary differential equation solvers used in fluid analysis. Contains different integrators optimized for various problem characteristics.
-
Field Summary
Fields Modifier and Type Field Description public boolean
cache
public Matrix
cutoff
public SolverOptions.Config
config
public boolean
force
public boolean
hide_immediate
public Matrix
init_sol
public int
iter_max
public double
iter_tol
public double
tol
public boolean
keep
public String
lang
public String
method
public boolean
remote
public String
remote_endpoint
public SolverOptions.ODESolvers
odesolvers
public int
samples
public int
seed
public boolean
stiff
public Array<double>
timespan
public Double
timestep
public VerboseLevel
verbose
-
Constructor Summary
Constructors Constructor Description SolverOptions()
Creates SolverOptions with default settings. SolverOptions(SolverType solverType)
Creates SolverOptions with defaults customized for a specific solver type.
-
Method Summary
Modifier and Type Method Description SolverOptions
copy()
Creates a deep copy of this SolverOptions instance. SolverOptions
cutoff(int s)
Sets the numerical cutoff threshold as a scalar value (builder pattern). SolverOptions
cutoff(double s)
Sets the numerical cutoff threshold as a scalar value (builder pattern). SolverOptions
cutoff(Matrix cutoffMatrix)
Sets the numerical cutoff threshold as a matrix (builder pattern). Matrix
getCutoffMatrix(int nstations, int nclasses)
Ensures the cutoff is properly dimensioned for the given network structure. SolverOptions
keep(boolean s)
Sets whether to keep intermediate results and temporary files (builder pattern). SolverOptions
method(String s)
Sets the solution method/algorithm (builder pattern). SolverOptions
samples(int s)
Sets the number of samples for simulation methods (builder pattern). SolverOptions
seed(int s)
Sets the random number generator seed (builder pattern). void
setODEMaxStep(double odeMaxStep)
Sets the maximum step size for ODE solvers and updates all integrators. void
setODEMinStep(double odeMinStep)
Sets the minimum step size for ODE solvers and updates all integrators. SolverOptions
verbose(VerboseLevel s)
Sets the verbosity level for solver output (builder pattern). SolverOptions
verbose(boolean s)
Sets the verbosity level using a boolean flag (builder pattern). SolverOptions
force(boolean force)
Forces solver execution even when validation fails (builder pattern).
-
-
-
Constructor Detail
-
SolverOptions
SolverOptions()
Creates SolverOptions with default settings.
-
SolverOptions
SolverOptions(SolverType solverType)
Creates SolverOptions with defaults customized for a specific solver type.- Parameters:
solverType
- the type of solver to configure defaults for, or null for generic defaults
-
-
Method Detail
-
copy
SolverOptions copy()
Creates a deep copy of this SolverOptions instance. All fields including nested objects are properly cloned.
- Returns:
a deep copy of this options object
-
cutoff
SolverOptions cutoff(int s)
Sets the numerical cutoff threshold as a scalar value (builder pattern). This creates a uniform cutoff matrix where all stations and classes use the same cutoff. The matrix will be properly dimensioned when the solver runs.
- Parameters:
s
- cutoff value to apply uniformly- Returns:
this SolverOptions instance for method chaining
-
cutoff
SolverOptions cutoff(double s)
Sets the numerical cutoff threshold as a scalar value (builder pattern). This creates a uniform cutoff matrix where all stations and classes use the same cutoff. The matrix will be properly dimensioned when the solver runs.
- Parameters:
s
- cutoff value to apply uniformly- Returns:
this SolverOptions instance for method chaining
-
cutoff
SolverOptions cutoff(Matrix cutoffMatrix)
Sets the numerical cutoff threshold as a matrix (builder pattern). The matrix should have dimensions nstations × nclasses where each element specifies the cutoff for a specific station-class combination.
- Parameters:
cutoffMatrix
- Matrix of cutoff values with dimensions nstations × nclasses- Returns:
this SolverOptions instance for method chaining
-
getCutoffMatrix
Matrix getCutoffMatrix(int nstations, int nclasses)
Ensures the cutoff is properly dimensioned for the given network structure. If cutoff is null, initializes it to POSITIVE_INFINITY for all stations and classes. If cutoff is a 1x1 matrix (scalar), expands it to full dimensions. If cutoff is already properly dimensioned, leaves it unchanged.
- Parameters:
nstations
- Number of stations in the networknclasses
- Number of job classes in the network- Returns:
The properly dimensioned cutoff matrix
-
keep
SolverOptions keep(boolean s)
Sets whether to keep intermediate results and temporary files (builder pattern).
- Parameters:
s
- true to keep files, false to clean up- Returns:
this SolverOptions instance for method chaining
-
method
SolverOptions method(String s)
Sets the solution method/algorithm (builder pattern).
- Parameters:
s
- method name (e.g.- Returns:
this SolverOptions instance for method chaining
-
samples
SolverOptions samples(int s)
Sets the number of samples for simulation methods (builder pattern).
- Parameters:
s
- number of samples to generate- Returns:
this SolverOptions instance for method chaining
-
seed
SolverOptions seed(int s)
Sets the random number generator seed (builder pattern).
- Parameters:
s
- seed value for reproducible random number generation- Returns:
this SolverOptions instance for method chaining
-
setODEMaxStep
void setODEMaxStep(double odeMaxStep)
Sets the maximum step size for ODE solvers and updates all integrators.
- Parameters:
odeMaxStep
- maximum step size for numerical integration
-
setODEMinStep
void setODEMinStep(double odeMinStep)
Sets the minimum step size for ODE solvers and updates all integrators.
- Parameters:
odeMinStep
- minimum step size for numerical integration
-
verbose
SolverOptions verbose(VerboseLevel s)
Sets the verbosity level for solver output (builder pattern).
- Parameters:
s
- verbosity level- Returns:
this SolverOptions instance for method chaining
-
verbose
SolverOptions verbose(boolean s)
Sets the verbosity level using a boolean flag (builder pattern).
- Parameters:
s
- true for standard output, false for silent mode- Returns:
this SolverOptions instance for method chaining
-
force
SolverOptions force(boolean force)
Forces solver execution even when validation fails (builder pattern).
- Parameters:
force
- true to force execution despite validation failures- Returns:
this SolverOptions instance for method chaining
-
-