L-shaped solvers
Documentation for StochasticPrograms.jl
's L-shaped solvers.
Index
StochasticPrograms.LShaped.AbstractLShapedAttribute
StochasticPrograms.LShaped.Aggregate
StochasticPrograms.LShaped.AggregationParameter
StochasticPrograms.LShaped.Aggregator
StochasticPrograms.LShaped.AsynchronousExecution
StochasticPrograms.LShaped.ClusterAggregate
StochasticPrograms.LShaped.ClusterAggregation
StochasticPrograms.LShaped.ClusterByReference
StochasticPrograms.LShaped.CombinatorialCuts
StochasticPrograms.LShaped.CombinatorialCutsMaster
StochasticPrograms.LShaped.CombinatorialCutsWorker
StochasticPrograms.LShaped.Consolidate
StochasticPrograms.LShaped.Consolidation
StochasticPrograms.LShaped.ConsolidationParameter
StochasticPrograms.LShaped.Consolidator
StochasticPrograms.LShaped.Convexification
StochasticPrograms.LShaped.ConvexificationMaster
StochasticPrograms.LShaped.ConvexificationWorker
StochasticPrograms.LShaped.DontAggregate
StochasticPrograms.LShaped.DontConsolidate
StochasticPrograms.LShaped.DontRegularize
StochasticPrograms.LShaped.DynamicAggregate
StochasticPrograms.LShaped.DynamicAggregation
StochasticPrograms.LShaped.FeasibilityCuts
StochasticPrograms.LShaped.FeasibilityCutsMaster
StochasticPrograms.LShaped.FeasibilityCutsWorker
StochasticPrograms.LShaped.FeasibilityStrategy
StochasticPrograms.LShaped.GranulatedAggregate
StochasticPrograms.LShaped.GranulatedAggregation
StochasticPrograms.LShaped.Hierarchical
StochasticPrograms.LShaped.HybridAggregate
StochasticPrograms.LShaped.HybridAggregation
StochasticPrograms.LShaped.IgnoreFeasibility
StochasticPrograms.LShaped.IgnoreIntegers
StochasticPrograms.LShaped.IntegerParameter
StochasticPrograms.LShaped.IntegerStrategy
StochasticPrograms.LShaped.Kmedoids
StochasticPrograms.LShaped.LShapedAlgorithm
StochasticPrograms.LShaped.LV
StochasticPrograms.LShaped.LevelSet
StochasticPrograms.LShaped.NoAggregation
StochasticPrograms.LShaped.NoConsolidation
StochasticPrograms.LShaped.NoFeasibilityAlgorithm
StochasticPrograms.LShaped.NoIntegerAlgorithm
StochasticPrograms.LShaped.NoRegularization
StochasticPrograms.LShaped.Optimizer
StochasticPrograms.LShaped.PartialAggregate
StochasticPrograms.LShaped.PartialAggregation
StochasticPrograms.LShaped.RD
StochasticPrograms.LShaped.RawConsolidationParameter
StochasticPrograms.LShaped.RawIntegerParameter
StochasticPrograms.LShaped.RawRegularizationParameter
StochasticPrograms.LShaped.RegularizationParameter
StochasticPrograms.LShaped.RegularizedDecomposition
StochasticPrograms.LShaped.Regularizer
StochasticPrograms.LShaped.SelectClosest
StochasticPrograms.LShaped.SelectDecaying
StochasticPrograms.LShaped.SelectRandom
StochasticPrograms.LShaped.SelectUniform
StochasticPrograms.LShaped.SerialExecution
StochasticPrograms.LShaped.SortByReference
StochasticPrograms.LShaped.StaticCluster
StochasticPrograms.LShaped.SynchronousExecution
StochasticPrograms.LShaped.TR
StochasticPrograms.LShaped.TrustRegion
StochasticPrograms.LShaped.FullAggregation
StochasticPrograms.LShaped.absolute_distance
StochasticPrograms.LShaped.angular_distance
StochasticPrograms.LShaped.at_tolerance
StochasticPrograms.LShaped.get_aggregation_attribute
StochasticPrograms.LShaped.get_consolidation_attribute
StochasticPrograms.LShaped.get_regularization_attribute
StochasticPrograms.LShaped.set_aggregation_attribute
StochasticPrograms.LShaped.set_aggregation_attribute
StochasticPrograms.LShaped.set_aggregation_attributes
StochasticPrograms.LShaped.set_aggregation_attributes
StochasticPrograms.LShaped.set_consolidation_attribute
StochasticPrograms.LShaped.set_consolidation_attribute
StochasticPrograms.LShaped.set_consolidation_attributes
StochasticPrograms.LShaped.set_consolidation_attributes
StochasticPrograms.LShaped.set_regularization_attribute
StochasticPrograms.LShaped.set_regularization_attribute
StochasticPrograms.LShaped.set_regularization_attributes
StochasticPrograms.LShaped.set_regularization_attributes
StochasticPrograms.LShaped.spatioangular_distance
API
StochasticPrograms.LShaped.LShapedAlgorithm
— TypeLShapedAlgorithm
Functor object for the L-shaped algorithm.
...
Algorithm parameters
τ::AbstractFloat = 1e-6
: Relative tolerance for convergence checks.debug::Bool = false
: Specifies if extra information should be saved for debugging purposes. Defaults to false for memory efficiency.cut_scaling::AbstractFloat = 1.0
: Rescaling factor for cutting planes to improve numerical stability.log::Bool = true
: Specifices if L-shaped procedure should be logged on standard output or not.
...
StochasticPrograms.LShaped.AbstractLShapedAttribute
— TypeAbstractLShapedAttribute
Abstract supertype for attribute objects specific to the L-shaped algorithm.
StochasticPrograms.LShaped.AggregationParameter
— TypeAggregationParameter
Abstract supertype for aggregation-specific attributes.
StochasticPrograms.LShaped.Aggregator
— TypeAggregator
An optimizer attribute for specifying an aggregation procedure to be used in the L-shaped algorithm. Options are:
NoAggregation
: Multi-cut L-shaped algorithm (default)PartialAggregation
: ?PartialAggregation for parameter descriptions.FullAggregation
: ?FullAggregation for parameter descriptions.DynamicAggregation
: ?DynamicAggregation for parameter descriptions.ClusterAggregation
: ?ClusterAggregation for parameter descriptions.HybridAggregation
: ?HybridAggregation for parameter descriptions.
StochasticPrograms.LShaped.ConsolidationParameter
— TypeConsolidationParameter
Abstract supertype for consolidation-specific attributes.
StochasticPrograms.LShaped.Consolidator
— TypeConsolidator
An optimizer attribute for specifying a consolidation procedure to be used in the L-shaped algorithm. Options are:
NoConsolidation
(default)Consolidation
StochasticPrograms.LShaped.FeasibilityStrategy
— TypeFeasibilityStrategy
An optimizer attribute for specifying a strategy for dealing with second-stage feasibility the L-shaped algorithm. Options are:
IgnoreFeasibility
(default)FeasibilityCuts
StochasticPrograms.LShaped.IntegerParameter
— TypeIntegerParameter
Abstract supertype for integer-specific attributes.
StochasticPrograms.LShaped.IntegerStrategy
— TypeIntegerStrategy
An optimizer attribute for specifying a strategy for dealing with integers the L-shaped algorithm. Options are:
StochasticPrograms.LShaped.RegularizationParameter
— TypeRegularizationParameter
Abstract supertype for regularization-specific attributes.
StochasticPrograms.LShaped.Regularizer
— TypeRegularizer
An optimizer attribute for specifying a regularization procedure to be used in the L-shaped algorithm. Options are:
NoRegularization
: L-shaped algorithm (default)RegularizedDecomposition
: Regularized decomposition ?RegularizedDecomposition for parameter descriptions.TrustRegion
: Trust-region ?TrustRegion for parameter descriptions.LevelSet
: Level-set ?LevelSet for parameter descriptions.
StochasticPrograms.LShaped.Optimizer
— TypeOptimizer(; <keyword arguments>)
Return an L-shaped optimizer. ...
Arguments
master_optimizer::AbstractOptimizer
: MathOptInterface solver capable of solving linear (and possibly quadratic) programs.subproblem_optimizer::AbstractOptimizer
: Optionally specify a different solver for the subproblems.feasibility_cuts::Bool = false
: Specify if feasibility cuts should be usedregularize::AbstractRegularizer = DontRegularize()
: Specify regularization procedure (DontRegularize, RegularizedDecomposition/RD/WithRegularizedDecomposition, TrustRegion/TR/WithTrustRegion, LevelSet/LV/WithLevelSets).aggregate::AbstractAggregator = DontAggregate()
: Specify aggregation procedure (DontAggregate, Aggregate, PartialAggregate, DynamicAggregate, ClusterAggregate, GranulatedAggregate, HybridAggregate)consolidate::AbstractConsolidator = DontConsolidate()
: Specify consolidation procedure (DontConsolidate, Consolidate)execution::Execution = Serial
: Specify how algorithm should be executed (Serial, Synchronous, Asynchronous). Distributed variants requires worker cores.- <keyword arguments>: Algorithm specific parameters, See
?LShaped
for list of possible arguments and default values.
...
StochasticPrograms.LShaped.get_aggregation_attribute
— Methodget_aggregation_attribute(stochasticprogram::StochasticProgram, name::String)
Return the value associated with the aggregation-specific attribute named name
in stochasticprogram
.
See also: set_aggregation_attribute
, set_aggregation_attributes
.
StochasticPrograms.LShaped.get_consolidation_attribute
— Methodget_consolidation_attribute(stochasticprogram::StochasticProgram, name::String)
Return the value associated with the consolidation-specific attribute named name
in stochasticprogram
.
See also: set_consolidation_attribute
, set_consolidation_attributes
.
StochasticPrograms.LShaped.get_regularization_attribute
— Methodget_regularization_attribute(stochasticprogram::StochasticProgram, name::String)
Return the value associated with the regularization-specific attribute named name
in stochasticprogram
.
See also: set_regularization_attribute
, set_regularization_attributes
.
StochasticPrograms.LShaped.set_aggregation_attribute
— Methodset_aggregation_attribute(stochasticprogram::StochasticProgram, name::Union{Symbol, String}, value)
Sets the aggregation-specific attribute identified by name
to value
.
StochasticPrograms.LShaped.set_aggregation_attributes
— Methodset_aggregation_attributes(stochasticprogram::StochasticProgram, pairs::Pair...)
Given a list of attribute => value
pairs or a collection of keyword arguments, calls set_aggregation_attribute(stochasticprogram, attribute, value)
for each pair.
StochasticPrograms.LShaped.set_consolidation_attribute
— Methodset_consolidation_attribute(stochasticprogram::StochasticProgram, name::Union{Symbol, String}, value)
Sets the consolidation-specific attribute identified by name
to value
.
StochasticPrograms.LShaped.set_consolidation_attributes
— Methodset_consolidation_attributes(stochasticprogram::StochasticProgram, pairs::Pair...)
Given a list of attribute => value
pairs or a collection of keyword arguments, calls set_consolidation_attribute(stochasticprogram, attribute, value)
for each pair.
StochasticPrograms.LShaped.set_regularization_attribute
— Methodset_regularization_attribute(stochasticprogram::StochasticProgram, name::Union{Symbol, String}, value)
Sets the regularization-specific attribute identified by name
to value
.
StochasticPrograms.LShaped.set_regularization_attributes
— Methodset_regularization_attributes(stochasticprogram::StochasticProgram, pairs::Pair...)
Given a list of attribute => value
pairs or a collection of keyword arguments, calls set_regularization_attribute(stochasticprogram, attribute, value)
for each pair.
Execution
StochasticPrograms.LShaped.SerialExecution
— TypeSerialExecution
Functor object for using serial execution in a lshaped algorithm. Create by supplying a Serial
object through execution
in the LShapedSolver
factory function and then pass to a StochasticPrograms.jl
model.
StochasticPrograms.LShaped.SynchronousExecution
— TypeSynchronousExecution
Functor object for using synchronous execution in an L-shaped algorithm (assuming multiple Julia cores are available). Create by supplying a Synchronous
object through execution
in the LShapedSolver
factory function and then pass to a StochasticPrograms.jl
model.
StochasticPrograms.LShaped.AsynchronousExecution
— TypeAsynchronousExecution
Functor object for using synchronous execution in an L-shaped algorithm (assuming multiple Julia cores are available). Create by supplying a Asynchronous
object through execution
in the LShapedSolver
factory function and then pass to a StochasticPrograms.jl
model.
Feasibility
StochasticPrograms.LShaped.NoFeasibilityAlgorithm
— TypeNoFeasibilityAlgorithm
Empty functor object for running an L-shaped algorithm without dealing with second-stage feasibility.
StochasticPrograms.LShaped.IgnoreFeasibility
— TypeIgnoreFeasibility
Factory object for NoFeasibilityAlgorithm
. Passed by default to feasibility_strategy
in LShaped.Optimizer
.
StochasticPrograms.LShaped.FeasibilityCutsMaster
— TypeFeasibilityCutsMaster
Master functor object for using feasibility cuts in an L-shaped algorithm. Create by supplying a FeasibilityCuts
object through feasibility_strategy
in LShaped.Optimizer
or set the FeasibilityStrategy
attribute.
StochasticPrograms.LShaped.FeasibilityCutsWorker
— TypeFeasibilityCutsWorker
Worker functor object for using feasibility cuts in an L-shaped algorithm. Create by supplying a FeasibilityCuts
object through feasibility_strategy
in LShaped.Optimizer
or set the FeasibilityStrategy
attribute.
StochasticPrograms.LShaped.FeasibilityCuts
— TypeIgnoreFeasibility
Factory object for using feasibility cuts in an L-shaped algorithm.
Integers
StochasticPrograms.LShaped.RawIntegerParameter
— TypeRawIntegerAlgorithmParameter
An optimizer attribute used for raw parameters of the integer algorithm. Defers to RawOptimizerAttribute
.
StochasticPrograms.LShaped.IgnoreIntegers
— TypeIgnoreIntegers
Factory object for NoIntegerAlgorithm
. Passed by default to integer_strategy
in LShaped.Optimizer
.
StochasticPrograms.LShaped.NoIntegerAlgorithm
— TypeNoIntegerAlgorithm
Empty functor object for running an L-shaped algorithm without dealing with integer variables.
StochasticPrograms.LShaped.CombinatorialCuts
— TypeCombinatorialCuts
Factory object for CombinatorialCuts
. Pass to integer_strategy
in LShaped.Optimizer
or set the IntegerStrategy
attribute.
...
Parameters
lower_bound::AbstractFloat = -1e10
: Set a lower bound on the second-stage objective, removing the need to approximate it.alternate::Bool = false
: Specify if algorithm should alternate between solving relaxed problems (generating regular optimality cuts) and unrelaxed problems (generating combinatorial cuts)update_L_every::Integer = 0
: Set the frequency at which the lower bound approximation should be updated. Only approximate once if set to zero.optimizer = nothing
: Optionally specify an optimizer used to solve auxilliary problems in theLiftAndProject
orCuttingPlaneTree
strategies.
...
StochasticPrograms.LShaped.CombinatorialCutsMaster
— TypeCombinatorialCutsMaster
Master functor object for using weak optimality cuts in an integer L-shaped algorithm. Requires all first-stage decisions to be binary. Create by supplying a CombinatorialCuts
object through integer_strategy
in LShaped.Optimizer
or set the IntegerStrategy
attribute.
StochasticPrograms.LShaped.CombinatorialCutsWorker
— TypeCombinatorialCutsWorker
Worker functor object for using weak optimality cuts in an integer L-shaped algorithm. Create by supplying a CombinatorialCuts
object through integer_strategy
in LShaped.Optimizer
or set the IntegerStrategy
attribute.
StochasticPrograms.LShaped.Convexification
— TypeConvexification
Factory object for using convexification to handle integer recourse. Pass to integer_strategy
in LShaped.Optimizer
or set the IntegerStrategy
attribute.
...
Parameters
maximum_iterations::Integer = 1
: Determines the number of iterations spent generating cutting-planes each time a subproblem is solved.strategy::ConvexificationStrategy = Gomory()
: Specify convexification strategy (Gomory
,LiftAndProject
,CuttingPlaneTree
)optimizer = nothing
: Optionally specify an optimizer used to solve auxilliary problems in theLiftAndProject
orCuttingPlaneTree
strategies.
...
StochasticPrograms.LShaped.ConvexificationMaster
— TypeConvexificationMaster
Master functor object for using weak optimality cuts in an integer L-shaped algorithm. Requires all first-stage decisions to be binary. Create by supplying a Convexification
object through integer_strategy
in LShaped.Optimizer
or set the IntegerStrategy
attribute.
StochasticPrograms.LShaped.ConvexificationWorker
— TypeConvexificationWorker
Worker functor object for using weak optimality cuts in an integer L-shaped algorithm. Create by supplying a Convexification
object through integer_strategy
in LShaped.Optimizer
or set the IntegerStrategy
attribute.
Regularization
StochasticPrograms.LShaped.set_regularization_attribute
— Functionset_regularization_attribute(stochasticprogram::StochasticProgram, name::Union{Symbol, String}, value)
Sets the regularization-specific attribute identified by name
to value
.
StochasticPrograms.LShaped.set_regularization_attributes
— Functionset_regularization_attributes(stochasticprogram::StochasticProgram, pairs::Pair...)
Given a list of attribute => value
pairs or a collection of keyword arguments, calls set_regularization_attribute(stochasticprogram, attribute, value)
for each pair.
StochasticPrograms.LShaped.RawRegularizationParameter
— TypeRawRegularizationParameter
An optimizer attribute used for raw parameters of the regularizer. Defers to RawOptimizerAttribute
.
StochasticPrograms.LShaped.NoRegularization
— TypeNoRegularization
Empty functor object for running an L-shaped algorithm without regularization.
StochasticPrograms.LShaped.DontRegularize
— TypeDontRegularize
Factory object for NoRegularization
. Passed by default to regularize
in LShaped.Optimizer
.
StochasticPrograms.LShaped.RegularizedDecomposition
— TypeRegularizedDecomposition
Functor object for using regularized decomposition regularization in an L-shaped algorithm. Create by supplying an RD
object through regularize
in LShaped.Optimizer
or by setting the Regularizer
attribute.
...
Parameters
σ::AbstractFloat = 1.0
: Initial value of regularization parameter. Controls the relative penalty of the deviation from the current major iterate.σ̅::AbstractFloat = 4.0
: Maximum value of the regularization parameter.σ̲::AbstractFloat = 0.5
: Minimum value of the regularization parameter.log::Bool = true
: Specifices if L-shaped procedure should be logged on standard output or not.penaltyterm::PenaltyTerm = Quadratic
: Specify penaltyterm variant (Quadratic
,InfNorm
, [ManhattanNorm
][@ref])
...
StochasticPrograms.LShaped.RD
— TypeRD
Factory object for RegularizedDecomposition
. Pass to regularize
in LShaped.Optimizer
or set the Regularizer
attribute. Equivalent factory calls: RD
, WithRD
, RegularizedDecomposition
, WithRegularizedDecomposition
. See ?RegularizedDecomposition for parameter descriptions.
StochasticPrograms.LShaped.TrustRegion
— TypeTrustRegion
Functor object for using trust-region regularization in an L-shaped algorithm. Create by supplying a TR
object through regularize
in LShaped.Optimizer
or by setting the Regularizer
attribute.
...
Parameters
γ::T = 1e-4
: Relative tolerance for deciding if a minor iterate should be accepted as a new major iterate.Δ::AbstractFloat = 1.0
: Initial size of ∞-norm trust-region.Δ̅::AbstractFloat = 1000.0
: Maximum size of ∞-norm trust-region.
...
StochasticPrograms.LShaped.TR
— TypeTR
Factory object for TrustRegion
. Pass to regularize
in LShaped.Optimizer
or set the Regularizer
attribute.. Equivalent factory calls: TR
, WithTR
, TrustRegion
, WithTrustRegion
. See ?TrustRegion for parameter descriptions.
StochasticPrograms.LShaped.LevelSet
— TypeLevelSet
Functor object for using level-set regularization in an L-shaped algorithm. Create by supplying an LV
object through regularize
in LShaped.Optimizer
or by setting the Regularizer
attribute.
...
Parameters
λ::AbstractFloat = 0.5
: Controls the level position L = (1-λ)θ + λQ̃, a convex combination of the current lower and upper bound.penaltyterm::PenaltyTerm = Quadratic
: Specify penaltyterm variant (Quadratic
,InfNorm
, [ManhattanNorm
][@ref])
...
StochasticPrograms.LShaped.LV
— TypeLV
Factory object for LevelSet
. Pass to regularize
in LShaped.Optimizer
or set the Regularizer
attribute. Equivalent factory calls: LV
, WithLV
, LevelSet
, WithLevelSets
. See ?LevelSet for parameter descriptions.
Aggregation
StochasticPrograms.LShaped.set_aggregation_attribute
— Functionset_aggregation_attribute(stochasticprogram::StochasticProgram, name::Union{Symbol, String}, value)
Sets the aggregation-specific attribute identified by name
to value
.
StochasticPrograms.LShaped.set_aggregation_attributes
— Functionset_aggregation_attributes(stochasticprogram::StochasticProgram, pairs::Pair...)
Given a list of attribute => value
pairs or a collection of keyword arguments, calls set_aggregation_attribute(stochasticprogram, attribute, value)
for each pair.
StochasticPrograms.LShaped.DontAggregate
— TypeDontAggregate
Factory object for NoAggregation
. Passed by default to aggregate
in LShaped.Optimizer
.
StochasticPrograms.LShaped.NoAggregation
— TypeNoAggregation
Empty functor object for running an L-shaped algorithm without aggregation (multi-cut L-shaped).
StochasticPrograms.LShaped.Aggregate
— TypeAggregate
Factory object for FullAggregation
. Pass to aggregate
in LShaped.Optimizer
or by set the Aggregator
attribute.
StochasticPrograms.LShaped.PartialAggregate
— TypePartialAggregate
Factory object for PartialAggregation
. Pass to aggregate
in LShaped.Optimizer
or set the Aggregator
attribute. See ?PartialAggregation for parameter descriptions.
StochasticPrograms.LShaped.PartialAggregation
— TypePartialAggregation
Functor object for using partial aggregation in an L-shaped algorithm. Create by supplying a PartialAggregate
object through aggregate
in LShaped.Optimizer
or by setting the Aggregator
attribute.
...
Parameters
size::Int
: Number of cuts in each aggregate
...
StochasticPrograms.LShaped.FullAggregation
— MethodFullAggregation
Functor object for using complete aggregation in an L-shaped algorithm. Create by supplying an Aggregate
object through aggregate
in the LShapedSolver
factory function and then pass to a StochasticPrograms.jl
model.
StochasticPrograms.LShaped.DynamicAggregate
— TypeDynamicAggregate(num_aggregates::Integer, rule::AbstractSelectionRule; lock_after::Function = (τ,n)->false)
Factory object for DynamicAggregation
. Pass to aggregate
in LShaped.Optimizer
or set the Aggregator
attribute. See ?DynamicAggregation for parameter descriptions.
StochasticPrograms.LShaped.DynamicAggregation
— TypeDynamicAggregation
Functor object for using dynamic aggregation in an L-shaped algorithm. Create by supplying a DynamicAggregate
object through aggregate
in LShaped.Optimizer
or by setting the Aggregator
attribute.
The following selection rules are available
SelectUniform
SelectDecaying
- [
SelectRandom
](@ref SelectClosest
SortByReference
...
Parameters
num_aggregates::Int
: Number of aggregatesrule::SelectionRule
: Rule that determines which aggregate an incoming cut should be placed inlock_after::Function = (τ,n)->false
: Function that determines if the current aggregation scheme should be fixed, based on the current optimality gapτ
and the number of iterationsn
...
StochasticPrograms.LShaped.ClusterAggregate
— TypeClusterAggregate(rule::AbstractClusterRule; lock_after::Function = (τ,n)->false)
Factory object for ClusterAggregation
. Pass to aggregate
in LShaped.Optimizer
or set the Aggregator
attribute. See ?ClusterAggregation for parameter descriptions.
StochasticPrograms.LShaped.ClusterAggregation
— TypeClusterAggregation
Functor object for using cluster aggregation in an L-shaped algorithm. Create by supplying a ClusterAggregate
object through aggregate
in LShaped.Optimizer
or by setting the Aggregator
attribute.
The following cluster rules are available
StaticCluster
ClusterByReference
- [
Kmedoids
](@ref Hierarchical
...
Parameters
rule::ClusterRule
: Rule that determines how cuts should be sorted into clusterslock_after::Function = (τ,n)->false
: Function that determines if the current aggregation scheme should be fixed, based on the current optimality gapτ
and the number of iterationsn
...
StochasticPrograms.LShaped.GranulatedAggregate
— TypeGranulatedAggregate
Factory object for GranulatedAggregation
. Pass to aggregate
in LShaped.Optimizer
or set the Aggregator
attribute. See ?GranulatedAggregation for parameter descriptions.
StochasticPrograms.LShaped.GranulatedAggregation
— TypeGranulatedAggregation
Functor object for using partial aggregation in an L-shaped algorithm. Create by supplying a GranulatedAggregate
object through aggregate
in LShaped.Optimizer
or by setting the Aggregator
attribute.
...
Parameters
size::Int
: Number of cuts in each aggregate
...
StochasticPrograms.LShaped.HybridAggregate
— TypeHybridAggregate(initial::AbstractAggregator, final::AbstractAggregator, τ::AbstractFloat)
Factory object for HybridAggregation
. Pass to aggregate
in LShaped.Optimizer
or by setting the Aggregator
attribute. See ?HybridAggregation for parameter descriptions.
StochasticPrograms.LShaped.HybridAggregation
— TypeHybridAggregation
Functor object for using hybrid aggregation in an L-shaped algorithm. Create by supplying a HybridAggregate
object through aggregate
in LShaped.Optimizer
or by setting the Aggregator
attribute.
...
Parameters
initial::AbstractAggregator
: Initial aggregation schemefinal::AbstractAggregator
: Final aggregation schemeτ::T
: The active aggregation scheme is switched frominitial
tofinal
when the optimality gap decreases belowτ
...
Selection rules
StochasticPrograms.LShaped.SelectClosest
— TypeSelectClosest(τ::AbstractFloat; distance::Function = absolute_distance)
Incoming cuts are placed into the closest aggregate, according the supplied distance
function. An empty aggregate is chosen if no aggregate is within the tolerance τ
The following distance measures are available
absolute_distance
angular_distance
- [
spatioangular_distance
](@ref
StochasticPrograms.LShaped.SelectDecaying
— TypeSelectDecaying(T₀::Integer, T̲::Integer = 1, γ::T)
Behaves like SelectUniform
, but the uniform aggregate size decays by γ
each iteration, starting from T₀
. T̲
is an optional lower bound on the aggregate size.
StochasticPrograms.LShaped.SelectRandom
— TypeSelectRandom(max = Inf)
Incoming cuts are placed into aggregates randomly. An optional maximum number of cuts max
can be specified.
StochasticPrograms.LShaped.SelectUniform
— TypeSelectUniform(n::Integer)
Incoming cuts are placed into aggregates uniformly, so that each aggregate has at most n
cuts. Behaves as PartialAggregation
.
StochasticPrograms.LShaped.SortByReference
— TypeSortByReference(τ::AbstractFloat; distance::Function = absolute_distance)
Incoming cuts are placed into an aggregate based on the distance to a reference cut, according the supplied distance
function. Behaves as SelectClosest
if not withing the tolerance τ
to the reference cut.
The following distance measures are available
absolute_distance
angular_distance
- [
spatioangular_distance
](@ref
Cluster rules
StochasticPrograms.LShaped.ClusterByReference
— MethodClusterByReference(τ::AbstractFloat; distance::Function = absolute_distance)
Buffered cuts are aggregated if within the tolerance τ
to a reference cut, according the supplied distance
function. Behaves as multi-cut otherwise.
The following distance measures are available
absolute_distance
angular_distance
- [
spatioangular_distance
](@ref
StochasticPrograms.LShaped.Hierarchical
— TypeHierarchical(nclusters::Int; distance::Function = absolute_distance, linkage::Symbol = :single)
Buffered cuts are sorted into nclusters
clusters, using a Hierarchical algorithm, with the given linkage
, over a generalized distance
matrix.
The following distance measures are available
absolute_distance
angular_distance
- [
spatioangular_distance
](@ref
StochasticPrograms.LShaped.Kmedoids
— TypeKmedoids(nclusters::Int; distance::Function = absolute_distance)
Buffered cuts are sorted into nclusters
clusters, using a K-medoids algorithm over a generalized distance
matrix.
The following distance measures are available
absolute_distance
angular_distance
- [
spatioangular_distance
](@ref
StochasticPrograms.LShaped.StaticCluster
— TypeStaticCluster(clusters::Vector{Float64})
Buffered cuts are sorting according to the supplied weights clusters
Distance measures
StochasticPrograms.LShaped.absolute_distance
— Methodabsolute_distance(c₁::AnyOptimalityCut, c₂::AnyOptimalityCut)
Absolute distance between two optimality cuts
StochasticPrograms.LShaped.angular_distance
— Methodangular_distance(c₁::AnyOptimalityCut, c₂::AnyOptimalityCut)
Angular distance between two optimality cuts
StochasticPrograms.LShaped.spatioangular_distance
— Methodspatioangular_distance(c₁::AnyOptimalityCut, c₂::AnyOptimalityCut)
Spatioangular distance between two optimality cuts.
Consolidation
StochasticPrograms.LShaped.set_consolidation_attribute
— Functionset_consolidation_attribute(stochasticprogram::StochasticProgram, name::Union{Symbol, String}, value)
Sets the consolidation-specific attribute identified by name
to value
.
StochasticPrograms.LShaped.set_consolidation_attributes
— Functionset_consolidation_attributes(stochasticprogram::StochasticProgram, pairs::Pair...)
Given a list of attribute => value
pairs or a collection of keyword arguments, calls set_consolidation_attribute(stochasticprogram, attribute, value)
for each pair.
StochasticPrograms.LShaped.Consolidate
— TypeConsolidate
Factory object for Consolidation
. Pass to consolidate
in LShaped.Optimizer
or set the Consolidator
attribute. See ?Consolidation for parameter descriptions.
StochasticPrograms.LShaped.Consolidation
— TypeConsolidation
Functor object for using consolidation in an L-shaped algorithm. Create by supplying a Consolidate
object through consolidate
in LShaped.Optimizer
or by setting the Consolidator
attribute.
...
Algorithm parameters
tresh::T
= 0.95: Relative amount of redundant cuts in a former iteration required to consider the iteration redundantat::Int = 5.0
: Number of times an iteration can be redundant before consolidation is triggeredrebuild::Function = at_tolerance()
: Function deciding when the master model should be rebuilt according to performed consolidations
...
StochasticPrograms.LShaped.DontConsolidate
— TypeDontConsolidate
Factory object for NoConsolidation
. Passed by default to consolidate
in LShaped.Optimizer
.
StochasticPrograms.LShaped.NoConsolidation
— TypeNoConsolidation
Empty functor object for running the L-shaped algorithm without consolidation.
StochasticPrograms.LShaped.RawConsolidationParameter
— TypeRawConsolidationParameter
An optimizer attribute used for raw parameters of the consolidator. Defers to RawOptimizerAttribute
.
StochasticPrograms.LShaped.at_tolerance
— Methodat_tolerance(τ = 0.4, miniter = 0)
Rebuild master when at least nconsolidations*miniter
iterations has passed and the ratio of number of cuts in the consolidated collection and the number of cuts in the master model has decreased below τ
.