Low-Level Functions

Callback Creation and Retrieval

ProgressiveHedging.apply_to_subproblemFunction
apply_to_subproblem(to_apply::Function,
                    phd::PHData,
                    winf::WorkerInf,
                    scid::ScenarioID,
                    args::Tuple=(),
                    kwargs::NamedTuple=NamedTuple(),
                    )

Applies the function to_apply to the subproblem with scenario id scid.

source
ProgressiveHedging.cbFunction
cb(f::Function)
cb(f::Function, ext::Dict{Symbol,Any})
cb(f::Function, initialize::Function)
cb(f::Function, initialize::Function, ext::Dict{Symbol,Any})
cb(name::String, f::Function, ext::Dict{Symbol,Any})

Shorthand for Callback functions with the same signature.

source
ProgressiveHedging.mean_deviationFunction
mean_deviation(;tol::Float64=1e-8,
               save_deviations::Bool=false
               )::Callback

Implementation of a termination criterion given in section 2.3 of (Watson & Woodruff 2010). There it is called 'td'.

source
ProgressiveHedging.spcbFunction
spcb(f::Function)
spcb(f::Function, ext::Dict{Symbol,Any})
spcb(name::String, f::Function, ext::Dict{Symbol,Any})

Shorthand for SubproblemCallback.

source
ProgressiveHedging.variable_fixingFunction
variable_fixing(; lag=2, eq_tol=1e-8)::Callback

Implementation of the variable fixing convergence acceleration heuristic in section 2.2 of (Watson & Woodruff 2010).

source

ID Type Interactions

ProgressiveHedging.convert_to_variable_idsFunction
convert_to_variable_ids(phd::PHData, xid::XhatID)::Set{VariableID}

Convert the given consensus variable id to the contributing individual subproblem variable ids.

Arguments

  • phd::PHData : PH data structure for the corresponding problem
  • xid::XhatID : consensus variable id to convert
source
ProgressiveHedging.convert_to_xhat_idFunction
convert_to_xhat_id(phd::PHData, vid::VariableID)::XhatID

Convert the given VariableID to the consensus variable id (XhatID).

Arguments

  • phd::PHData : PH data structure for the corresponding problem
  • vid::VariableID : variable id to convert
source

Result Retrieval

ProgressiveHedging.residualsFunction
residuals(phd::PHData)::DataFrames.DataFrame

Return a DataFrame with absolute and relative residuals along with the components. See the save_residuals keyword argument on solve.

source
ProgressiveHedging.retrieve_wFunction
retrieve_w(phd::PHData)::DataFrames.DataFrame

Return a DataFrame with the final anticipativity constraint Lagrange multiplier values.

source

Problem Accessors

Scenario Tree

ProgressiveHedging.add_nodeFunction
add_node(tree::ScenarioTree, parent::ScenarioNode)

Add a node to the ScenarioTree tree with parent node parent. Return the added node. If the node to add is a leaf, use add_leaf instead.

source
ProgressiveHedging.add_leafFunction
add_leaf(tree::ScenarioTree, parent::ScenarioNode, probability<:Real)

Add a leaf to the ScenarioTree tree with parent node parent. The probability of this scenario occuring is given by probability. Returns the ScenarioID representing the scenario.

source
ProgressiveHedging.two_stage_treeFunction
two_stage_tree(n::Int)::ScenarioTree
two_stage_tree(p::Vector{R})::ScenarioTree where R <: Real

Construct and return a two-stage scenario tree with n scenarios with equal probability or a two-stage scenario tree with length(p) scenarios where probability of scenario s is p[s+1].

source

Variable Interactions

ProgressiveHedging.branch_valueFunction
branch_value(phd::PHData, vid::VariableID)::Float64

Returns the value of the variable associated with vid. Must be a branch variable.

See also: leaf_value, value

source
branch_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64

Returns the value of the variable associated with with scenario scen, stage stage and index idx. Must be a branch variable.

See also: leaf_value, value

source
ProgressiveHedging.is_integerFunction
is_integer(a::HatVariable)::Bool

Returns true if the consensus variable is an integer variable. The consensus variable is an integer if the contributing subproblem variables are all integer variables.

source
ProgressiveHedging.is_leafFunction
is_leaf(phd::PHData, xhid::XhatID)::Bool

Returns true if the given consensus variable id belongs to a leaf vertex in the scenario tree.

source
ProgressiveHedging.leaf_valueFunction
leaf_value(phd::PHData, vid::VariableID)::Float64
leaf_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64

Returns the value of the variable associated with vid or with scenario scen, stage stage and index idx. Must be a leaf variable.

WARNING: For computational efficiency, leaf values are collected only at the end of a PH run. Therefore, using this function in a callback will result in an error.

See also: branch_value, value

source
ProgressiveHedging.nameFunction
name(phd::PHData, vid::VariableID)::String

Returns the name of the consensus variable for the given VariableID.

source
name(phd::PHData, xid::XhatID)::String

Returns the name of the consensus variable for the given XhatID. The name is the same given to the individual scenario variables.

source
ProgressiveHedging.variablesFunction
variables(a::HatVariable)::Set{VariableID}

Returns the variable ids for all subproblem variables contributing to this variable.

source
ProgressiveHedging.w_valueFunction

w_value(phd::PHData, vid::VariableID)

Returns the value of the variable associated with vid. Only available for branch variables.

source
w_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64

Returns the value of the variable associated with scenario scen, stage stage and index idx. Only available for branch variables.

source
ProgressiveHedging.xhat_valueFunction

xhat_value(phd::PHData, xhid::VariableID)::Float64

Returns the value of the consensus variable associated with xhid. Only available for leaf variables after calling solve. Available for branch variables at any time.

source

xhat_value(phd::PHData, vid::VariableID)::Float64

Returns the value of the consensus variable associated with vid. Only available for leaf variables after calling solve. Available for branch variables at any time.

source

xhat_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64

Returns the value of the consensus variable associated with scenario scen, stage stage and index idx. Only available for leaf variables after calling solve. Available for branch variables at any time.

source