Class WorkerParameters
- Namespace
- OptalCP
- Assembly
- OptalCP.dll
Specifies the behavior of each worker separately.
public class WorkerParameters
- Inheritance
-
WorkerParameters
- Inherited Members
Remarks
WorkerParameters specify the behavior of each worker separately. It is part of the Parameters object.
If a parameter is not listed here, then it can be set only globally (in Parameters), not per worker. For example, timeLimit or logPeriod are global parameters.
Constructors
WorkerParameters()
Specifies the behavior of each worker separately.
public WorkerParameters()
Remarks
WorkerParameters specify the behavior of each worker separately. It is part of the Parameters object.
If a parameter is not listed here, then it can be set only globally (in Parameters), not per worker. For example, timeLimit or logPeriod are global parameters.
Properties
cumulPropagationLevel
How much to propagate constraints on cumul functions
public long? cumulPropagationLevel { get; set; }
Property Value
- long?
Remarks
This parameter controls the amount of propagation done for cumulative constraints (e.g., cumul <= limit) when used with a sum of Model.Pulse pulses.
Higher levels use more sophisticated algorithms that can detect more infeasibilities and prune more values from domains, but at the cost of increased computation time.
Propagation levels:
- Level 1: Basic timetable propagation
- Level 2: Adds time-table edge-finding
- Level 3: Adds disjunctive reasoning between pulses that are too high to overlap
- Level 4: Maximum propagation. Adds a redundant Model.NoOverlap over the pulses higher than half of the capacity, and max-energy reasoning that limits the length and height of pulses whose length or height is not fixed
Automatic selection (level 0):
When set to 0 (the default), the Parameters.preset chooses the level. The Default preset uses strong propagation. The Large preset uses a lower level to reduce the propagation overhead on big models. The exact levels may change between versions.
Performance considerations:
More propagation doesn't necessarily mean better overall performance. The trade-off depends on your problem:
Resource-constrained problems with tight capacity limits often benefit from higher propagation levels because cumulative reasoning can prune many infeasible assignments.
Problems with loose resource constraints may not benefit much from higher levels because the extra computation doesn't lead to significant pruning.
Very large problems may perform better with lower propagation levels because the overhead becomes prohibitive.
FDS search (see Parameters.searchType) typically benefits from higher propagation levels.
If you're unsure, start with the automatic selection (level 0) and let the preset choose.
var model = new Model();
// ... build your model with cumulative constraints ...
// Let the preset decide (default)
var result = model.Solve();
// Or use maximum propagation for resource-constrained problems
result = model.Solve(new Parameters { cumulPropagationLevel = 4 });
// Or use minimum propagation for very large problems
result = model.Solve(new Parameters { cumulPropagationLevel = 1 });
See also:
- Parameters.preset — for automatic configuration of propagation levels.
- Parameters.searchType — for choosing the search algorithm.
- Model.Pulse — for creating pulse contributions to cumulative functions.
fdsDualStrategy
A strategy to choose objective cuts during FDSDual search.
public string? fdsDualStrategy { get; set; }
Property Value
Remarks
Possible values are:
Minimum: Always change the cut by the minimum amount.Random: At each restart, randomly choose a value in range LB..UB. The default.Split: Always split the current range LB..UB in half.
The default value is Random.
integralPropagationLevel
How much to propagate integral expression
public long? integralPropagationLevel { get; set; }
Property Value
- long?
Remarks
This parameter controls the amount of propagation done for Model.Integral expressions. In particular, it controls whether the propagation also affects the minimum and the maximum length of the associated interval variable:
1: The length is updated only once during initial constraint propagation.2: The length is updated every time the expression is propagated.
The parameter takes an integer value in range 1..2.
The default value is 1.
lnsMode
LNS solution pool strategy.
public string? lnsMode { get; set; }
Property Value
Remarks
Controls how LNS manages its solution pool.
Auto: Let the Parameters.preset decide (the default). TheDefaultpreset resolvesAutotoRobust; theLargepreset resolves it toFocused.Robust: Maintain multiple solution tiers for diverse exploration. The solver keeps several solutions of varying quality and occasionally works on improving worse solutions. This provides robustness against getting stuck in local optima.Focused: Concentrate all LNS effort on improving the best solution. Secondary solution tiers are disabled, reducing memory and CPU overhead. Recommended for large problems where maintaining multiple solutions is too expensive.
The Large Parameters.preset automatically selects Focused mode. If you
explicitly set lnsMode to Robust or Focused, your value takes precedence over
the preset — for example, setting Robust keeps the multiple solution tiers even
under the Large preset.
var model = new Model();
// ... build your model ...
// Default: robust mode with multiple solution tiers
var result = model.Solve();
// Focused mode for large problems
result = model.Solve(new Parameters { lnsMode = "Focused" });
// Or use the Large preset, which enables Focused mode automatically
result = model.Solve(new Parameters { preset = "Large" });
See also:
- Parameters.preset — for automatic configuration based on problem size.
- Parameters.searchType — for choosing the search algorithm.
lnsUseWarmStartOnly
Use only the user-provided warm start as the initial solution in LNS
public bool? lnsUseWarmStartOnly { get; set; }
Property Value
- bool?
Remarks
When this parameter is on, the solver will use only the user-specified warm start solution for the initial solution phase in LNS. If no warm start is provided, the solver will search for its own initial solution as usual.
The default value is false.
noOverlapPropagationLevel
How much to propagate noOverlap constraints without transition times
public long? noOverlapPropagationLevel { get; set; }
Property Value
- long?
Remarks
This parameter controls the amount of propagation done for noOverlap constraints without transition times. For noOverlap constraints with transition times, see Parameters.noOverlapTransitionPropagationLevel. Higher levels use more sophisticated algorithms that can detect more infeasibilities and prune more values from domains, but at the cost of increased computation time.
Propagation levels:
- Level 1: Basic timetable propagation only
- Level 2: Adds detectable precedences algorithm
- Level 3: Adds edge-finding reasoning
- Level 4: Maximum propagation with all available algorithms
Automatic selection (level 0):
When set to 0 (the default), the Parameters.preset chooses the level. The Default preset uses strong propagation. The Large preset uses a lower level to reduce the propagation overhead on big models. The exact levels may change between versions.
Performance considerations:
More propagation doesn't necessarily mean better overall performance. The trade-off depends on your problem:
Dense scheduling problems with many overlapping intervals often benefit from higher propagation levels because the extra pruning reduces the search space significantly.
Sparse problems or very large problems may perform better with lower propagation levels because the overhead of sophisticated algorithms outweighs the benefit.
FDS search (see Parameters.searchType) typically benefits from higher propagation levels because it relies on strong propagation to guide the search.
If you're unsure, start with the automatic selection (level 0) and let the preset choose. You can then experiment with explicit levels if needed.
var model = new Model();
// ... build your model with noOverlap constraints ...
// Let the preset decide (default)
var result = model.Solve();
// Or use maximum propagation for dense problems
result = model.Solve(new Parameters { noOverlapPropagationLevel = 4 });
// Or use minimum propagation for very large problems
result = model.Solve(new Parameters { noOverlapPropagationLevel = 1 });
See also:
- Parameters.noOverlapTransitionPropagationLevel — for noOverlap constraints with transition times.
- Parameters.preset — for automatic configuration of propagation levels.
- Parameters.searchType — for choosing the search algorithm.
- Model.NoOverlap — for creating noOverlap constraints.
noOverlapTransitionPropagationLevel
How much to propagate noOverlap constraints with transition times
public long? noOverlapTransitionPropagationLevel { get; set; }
Property Value
- long?
Remarks
This parameter controls the amount of propagation done for noOverlap constraints with transition times. For noOverlap constraints without transition times, see Parameters.noOverlapPropagationLevel. Higher levels use more sophisticated algorithms that can detect more infeasibilities and prune more values from domains, but at the cost of increased computation time.
Propagation levels:
- Level 1: Reasoning on pairs of intervals and their transition times only
- Level 2: Adds detectable precedences algorithm
- Level 3: Adds edge-finding reasoning
- Level 4: Maximum propagation with all available algorithms
From level 2 on, the algorithms work with each interval extended to the left by the smallest transition time it can have from a preceding interval.
When the sequence is used in IntervalVar.Position, the propagation of the positions runs on every level.
Automatic selection (level 0):
When set to 0 (the default), the Parameters.preset chooses the level. The Default preset uses strong propagation. The Large preset uses a lower level to reduce the propagation overhead on big models. The exact levels may change between versions.
Performance considerations:
The same trade-offs apply as for Parameters.noOverlapPropagationLevel. Reasoning on pairs cannot detect that three or more intervals do not fit into a time window. When the transition times are small compared to the interval lengths, higher levels often pay off.
var model = new Model();
// ... build your model with noOverlap constraints with transition times ...
// Let the preset decide (default)
var result = model.Solve();
// Or use maximum propagation
result = model.Solve(new Parameters { noOverlapTransitionPropagationLevel = 4 });
See also:
- Parameters.noOverlapPropagationLevel — for noOverlap constraints without transition times.
- Parameters.preset — for automatic configuration of propagation levels.
- Model.NoOverlap — for creating noOverlap constraints.
positionPropagationLevel
How much to propagate position expressions on noOverlap constraints
public long? positionPropagationLevel { get; set; }
Property Value
- long?
Remarks
This parameter controls the amount of propagation done for position expressions on noOverlap constraints. The bigger the value, the more algorithms are used for propagation. It means that more time is spent by the propagation, and possibly more values are removed from domains. However, more propagation doesn't necessarily mean better performance. FDS search (see Parameters.searchType) usually benefits from higher propagation levels.
The parameter takes an integer value in range 1..3.
The default value is 2.
randomSeed
Random seed
public long? randomSeed { get; set; }
Property Value
- long?
Remarks
The solver breaks ties randomly using a pseudorandom number generator. This parameter sets the seed of the generator.
Note that when Parameters.nbWorkers is more than 1 then there is also another source of randomness: the time it takes for a message to pass from one worker to another. Therefore with 1 worker the solver is deterministic (random behavior depends only on random seed). With more workers the solver is not deterministic.
Even with the same random seed, the solver may behave differently on different platforms. This can be due to different implementations of certain functions such as std::sort.
The parameter takes an integer value.
The default value is 1.
Environment variable OPTALCP_RANDOM_SEED
When randomSeed is not explicitly set (i.e. it remains at its default value of 1), the solver checks the environment variable OPTALCP_RANDOM_SEED. If the variable is set:
- A numeric value (e.g.
42) is used directly as the random seed. - The special value
RANDOM(case-insensitive) tells the solver to generate a time-based seed.
This is useful for randomizing test runs without changing application code.
reservoirPropagationLevel
How much to propagate constraints on cumul functions
public long? reservoirPropagationLevel { get; set; }
Property Value
- long?
Remarks
This parameter controls the amount of propagation done for cumulative constraints (e.g., cumul <= limit, cumul >= limit) when used together with steps (Model.StepAtStart, Model.StepAtEnd, Model.StepAt).
The bigger the value, the more algorithms are used for propagation.
It means that more time is spent by the propagation, and possibly more values are removed from domains.
More propagation doesn't necessarily mean better performance.
FDS search (see Parameters.searchType) usually benefits from higher propagation levels.
The parameter takes an integer value in range 1..2.
The default value is 1.
searchType
Type of search to use
public string? searchType { get; set; }
Property Value
Remarks
This parameter controls which search algorithm the solver uses. Different search types have different strengths:
Auto: Automatically determined based on the Parameters.preset (the default). With theDefaultpreset, workers are distributed across LNS, FDS, and FDSDual. With theLargepreset, all workers use LNS.LNS: Large Neighborhood Search. Starts from an initial solution and iteratively improves it by relaxing and re-optimizing parts of the solution. Good for finding high-quality solutions quickly, especially on large problems. Works best when a good initial solution can be found.FDS: Failure-Directed Search. A systematic search that learns from failures to guide exploration. Uses restarts with no-good learning. Often effective at proving optimality and works well with strong propagation.FDSDual: Failure-Directed Search working on objective bounds. Similar to FDS but focuses on proving bounds on the objective value. Useful for optimization problems where you want to know how far from optimal your solutions are.SetTimes: Depth-first set-times search (not restarted). A simple chronological search that assigns start times in order. Can be effective for tightly constrained problems but generally less robust than other methods.
Interaction with presets:
When searchType is set to Auto, the actual search type is determined by the Parameters.preset:
Defaultpreset: Distributes workers across different search types. Half use LNS, 3/8 use FDS, and the rest use FDSDual. This portfolio approach provides robustness across different problem types.Largepreset: All workers use LNS. For very large problems, the overhead of systematic search methods like FDS becomes prohibitive, so LNS is used exclusively.
If you explicitly set searchType to a specific value (not Auto), that value is used regardless of the preset.
var model = new Model();
// ... build your model ...
// Let the preset decide (default behavior)
var result = model.Solve();
// Or explicitly use FDS for systematic search
result = model.Solve(new Parameters { searchType = "FDS" });
// Or use LNS for quick solutions on large problems
result = model.Solve(new Parameters { searchType = "LNS" });
See also:
- Parameters.preset — for automatic configuration of search and propagation.
- Parameters.noOverlapPropagationLevel — which works well with FDS at higher levels.
simpleLBWorker
Which worker computes simple lower bound
public long? simpleLBWorker { get; set; }
Property Value
- long?
Remarks
Simple lower bound is a bound such that infeasibility of a better objective can be proved by propagation only (without the search). The given worker computes simple lower bound before it starts the normal search. If a worker with the given number doesn't exist, then the lower bound is not computed.
The parameter takes an integer value in range -1..2147483647.
The default value is 0.