Low-Level Functions
ProgressiveHedging.add_leafProgressiveHedging.add_nodeProgressiveHedging.apply_to_subproblemProgressiveHedging.branch_valueProgressiveHedging.cbProgressiveHedging.consensus_variablesProgressiveHedging.convert_to_variable_idsProgressiveHedging.convert_to_xhat_idProgressiveHedging.get_callbackProgressiveHedging.get_callback_extProgressiveHedging.indexProgressiveHedging.is_integerProgressiveHedging.is_leafProgressiveHedging.leaf_valueProgressiveHedging.lower_boundsProgressiveHedging.mean_deviationProgressiveHedging.nameProgressiveHedging.print_timingProgressiveHedging.probabilityProgressiveHedging.residualsProgressiveHedging.retrieve_aug_obj_valueProgressiveHedging.retrieve_no_hat_historyProgressiveHedging.retrieve_no_hatsProgressiveHedging.retrieve_obj_valueProgressiveHedging.retrieve_solnProgressiveHedging.retrieve_wProgressiveHedging.retrieve_w_historyProgressiveHedging.retrieve_xhat_historyProgressiveHedging.rootProgressiveHedging.scenarioProgressiveHedging.scenario_bundleProgressiveHedging.scenario_treeProgressiveHedging.scenariosProgressiveHedging.scidProgressiveHedging.spcbProgressiveHedging.stageProgressiveHedging.stage_idProgressiveHedging.stidProgressiveHedging.two_stage_treeProgressiveHedging.valueProgressiveHedging.valueProgressiveHedging.valueProgressiveHedging.valueProgressiveHedging.valueProgressiveHedging.valueProgressiveHedging.valueProgressiveHedging.variable_fixingProgressiveHedging.variablesProgressiveHedging.w_valueProgressiveHedging.xhat_value
Callback Creation and Retrieval
ProgressiveHedging.apply_to_subproblem — Functionapply_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.
ProgressiveHedging.cb — Functioncb(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.
ProgressiveHedging.get_callback — Functionget_callback(phd::PHData, name::String)::CallbackRetrieve the callback with name name.
ProgressiveHedging.get_callback_ext — Functionget_callback_ext(phd::PHData, name::String)::Dict{Symbol,Any}Retrieve the external dictionary for callback name.
ProgressiveHedging.mean_deviation — Functionmean_deviation(;tol::Float64=1e-8,
save_deviations::Bool=false
)::CallbackImplementation of a termination criterion given in section 2.3 of (Watson & Woodruff 2010). There it is called 'td'.
ProgressiveHedging.spcb — Functionspcb(f::Function)
spcb(f::Function, ext::Dict{Symbol,Any})
spcb(name::String, f::Function, ext::Dict{Symbol,Any})Shorthand for SubproblemCallback.
ProgressiveHedging.variable_fixing — Functionvariable_fixing(; lag=2, eq_tol=1e-8)::CallbackImplementation of the variable fixing convergence acceleration heuristic in section 2.2 of (Watson & Woodruff 2010).
ID Type Interactions
ProgressiveHedging.convert_to_variable_ids — Functionconvert_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 problemxid::XhatID: consensus variable id to convert
ProgressiveHedging.convert_to_xhat_id — Functionconvert_to_xhat_id(phd::PHData, vid::VariableID)::XhatIDConvert the given VariableID to the consensus variable id (XhatID).
Arguments
phd::PHData: PH data structure for the corresponding problemvid::VariableID: variable id to convert
ProgressiveHedging.index — Functionindex(vid::VariableID)::IndexReturns the Index of the specified VariableID.
index(n::Int64)::IndexCreate Index from n.
ProgressiveHedging.scenario — Functionscenario(vid::VariableID)::ScenarioIDReturns the ScenarioID of the specified VariableID.
ProgressiveHedging.scid — Functionscid(n::Int64)::ScenarioIDCreate ScenarioID from n.
ProgressiveHedging.stage — Functionstage(vid::VariableID)::StageIDReturns the StageID of the specified VariableID.
ProgressiveHedging.stage_id — Functionstage_id(phd::PHData, xid::XhatID)::StageIDReturns the StageID in which the given consensus variable is.
ProgressiveHedging.stid — Functionstid(n::Int64)::StageIDCreate StageID from n.
ProgressiveHedging.value — Methodvalue(idx::Index)Return the raw (non-type safe) value of an Index
ProgressiveHedging.value — Methodvalue(nid::NodeID)Return the raw (non-type safe) value of a NodeID
ProgressiveHedging.value — Methodvalue(scid::ScenarioID)Return the raw (non-type safe) value of a ScenarioID
ProgressiveHedging.value — Methodvalue(stid::StageID)Return the raw (non-type safe) value of a StageID
Result Retrieval
ProgressiveHedging.lower_bounds — Functionlower_bounds(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the computed and saved lower bounds. See the lower_bound keyword argument on solve.
ProgressiveHedging.print_timing — Functionprint_timing([io::IO], phd::PHData)Prints timining information from the Progressive Hedging solve.
ProgressiveHedging.residuals — Functionresiduals(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with absolute and relative residuals along with the components. See the save_residuals keyword argument on solve.
ProgressiveHedging.retrieve_soln — Functionretrieve_soln(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the solution values of all consensus and leaf variables.
ProgressiveHedging.retrieve_aug_obj_value — Functionretrieve_aug_obj_value(phd::PHData)::Float64Return the current objective value including Lagrange and proximal PH terms of the stochastic program.
ProgressiveHedging.retrieve_obj_value — Functionretrieve_obj_value(phd::PHData)::Float64Return the current objective value without Lagrange and proximal PH terms.
ProgressiveHedging.retrieve_no_hats — Functionretrieve_no_hats(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the final nonconsensus variable values.
ProgressiveHedging.retrieve_no_hat_history — Functionretrieve_no_hat_history(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the saved nonconsensus variable values. See the save_iterates keyword argument on solve.
ProgressiveHedging.retrieve_w — Functionretrieve_w(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the final anticipativity constraint Lagrange multiplier values.
ProgressiveHedging.retrieve_w_history — Functionretrieve_w_history(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the saved PH Lagrange variable values. See the save_iterates keyword argument on solve.
ProgressiveHedging.retrieve_xhat_history — Functionretrieve_xhat_history(phd::PHData)::DataFrames.DataFrameReturn a DataFrame with the saved consensus variable values. See the save_iterates keyword argument on solve.
Problem Accessors
ProgressiveHedging.probability — Functionprobability(phd::PHData, scenario::ScenarioID)::Float64Returns the probability of the given scenario.
ProgressiveHedging.scenario_tree — Functionscenario_tree(phd::PHData)::ScenarioTreeReturns the scenario tree for created stochastic programming problem.
ProgressiveHedging.scenarios — Functionscenarios(phd::PHData)::Set{ScenarioID}Returns the set of all scenarios for the stochastic problem.
Scenario Tree
ProgressiveHedging.add_node — Functionadd_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.
ProgressiveHedging.add_leaf — Functionadd_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.
ProgressiveHedging.root — Functionroot(tree::ScenarioTree)Return the root node of the given ScenarioTree
ProgressiveHedging.two_stage_tree — Functiontwo_stage_tree(n::Int)::ScenarioTree
two_stage_tree(p::Vector{R})::ScenarioTree where R <: RealConstruct 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].
Variable Interactions
ProgressiveHedging.branch_value — Functionbranch_value(phd::PHData, vid::VariableID)::Float64Returns the value of the variable associated with vid. Must be a branch variable.
See also: leaf_value, value
branch_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64Returns 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
ProgressiveHedging.consensus_variables — Functionconsensus_variables(phd::PHData)::Dict{XhatID,HatVariable}Returns the collection of consensus variables for the problem.
ProgressiveHedging.is_integer — Functionis_integer(a::HatVariable)::BoolReturns true if the consensus variable is an integer variable. The consensus variable is an integer if the contributing subproblem variables are all integer variables.
ProgressiveHedging.is_leaf — Functionis_leaf(phd::PHData, xhid::XhatID)::BoolReturns true if the given consensus variable id belongs to a leaf vertex in the scenario tree.
ProgressiveHedging.leaf_value — Functionleaf_value(phd::PHData, vid::VariableID)::Float64
leaf_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64Returns 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
ProgressiveHedging.name — Functionname(phd::PHData, vid::VariableID)::StringReturns the name of the consensus variable for the given VariableID.
name(phd::PHData, xid::XhatID)::StringReturns the name of the consensus variable for the given XhatID. The name is the same given to the individual scenario variables.
ProgressiveHedging.scenario_bundle — Functionscenario_bundle(phd::PHData, xid::XhatID)::Set{ScenarioID}Returns the scenarios contributing to the consensus variable associated with xid.
ProgressiveHedging.value — Methodvalue(a::HatVariable)::Float64
Returns the current value of a.
ProgressiveHedging.value — Methodvalue(phd::PHData, vid::VariableID)
Returns the value of the variable associated with vid.
See also: branch_value, leaf_value
ProgressiveHedging.value — Methodvalue(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64
Returns the value of the variable associated with scenario scen, stage stage and index idx.
See also: branch_value, leaf_value
ProgressiveHedging.variables — Functionvariables(a::HatVariable)::Set{VariableID}Returns the variable ids for all subproblem variables contributing to this variable.
ProgressiveHedging.w_value — Functionw_value(phd::PHData, vid::VariableID)
Returns the value of the variable associated with vid. Only available for branch variables.
w_value(phd::PHData, scen::ScenarioID, stage::StageID, idx::Index)::Float64Returns the value of the variable associated with scenario scen, stage stage and index idx. Only available for branch variables.
ProgressiveHedging.xhat_value — Functionxhat_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.
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.
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.