Internal reference
Scenario tree
RandomizedProgressiveHedging.STreeNode
— TypeSTreeNode
Node object of the ScenarioTree
. Reference its father
node id and its childs
ids, along with the set of scenarios equivalent up to the depth
(or stage) of the node.
Progressive hedging
RandomizedProgressiveHedging.ph_subproblem_solve
— Functionph_subproblem_solve(pb, id_scen, u_scen, x_scen, μ, params)
Solve subproblem associated with scenario id_scen
, primal point x_scen
, dual point u_scen
and regularization μ
.
RandomizedProgressiveHedging.ph_initialization!
— Functionph_initialization!(x, u, y, pb, μ, subpbparams, printlev)
Compute a first global feasible point by solving each scenario independently and projecting the global strategy obtained onto the non-anticipatory subspace.
Synchronous
RandomizedProgressiveHedging.randsync_subproblem_solve
— Functionrandsync_subproblem_solve(pb::Problem, id_scen::ScenarioId, xz_scen, μ, params)
Solve and return the solution of the subproblem 'prox(fs/μ
) (xz_scen
)' where 'fs' is the cost function associated with the scenario `idscen`.
RandomizedProgressiveHedging.randsync_initialization!
— Functionrandsync_initialization!(z, pb, μ, subpbparams, printlev)
Compute a first global feasible point by solving each scenario independently and projecting the global strategy obtained onto the non-anticipatory subspace.
Synchronous parallel
RandomizedProgressiveHedging.randpar_remote_func
— Functionrandpar_remote_func(inwork::RemoteChannel, outres::RemoteChannel)
Solve and return the solution of the subproblem 'prox(fs/μ
) (v_scen
)' where 'fs' is the cost function associated with the scenario `idscen`.
RandomizedProgressiveHedging.randpar_initialization!
— Functionrandpar_initialization!(z, pb, μ, subpbparams, printlev, work_channel, results_channel)
Compute a first global feasible point by solving each scenario independently and projecting the global strategy obtained onto the non-anticipatory subspace. Independent solves are distributed on available workers.
RandomizedProgressiveHedging.randpar_init_workers
— Functionrandpar_init_workers(pb::Problem{T}, subpbparams::AbstractDict) where T<:AbstractScenario
Launch randpar_remote_func
in every available worker with correct channels, and pass subpbparams
to each worker.
RandomizedProgressiveHedging.randpar_terminate_workers
— Functionrandpar_terminate_workers(pb, work_channel, remotecalls_futures)
Send a signal so that all workers return and wait that all workers do.
Asynchronous
RandomizedProgressiveHedging.randasync_remote_func
— Functionrandasync_remote_func(inwork::RemoteChannel, outres::RemoteChannel, paramschan::RemoteChannel)
Solve and return the solution of the subproblem 'prox(fs/μ
) (v_scen
)' where 'fs' is the cost function associated with the scenario `idscen`.
RandomizedProgressiveHedging.randasync_initialization!
— Functionrandasync_initialization!(z, pb, μ, subpbparams, printlev, work_channel, results_channel)
Compute a first global feasible point by solving each scenario independently and projecting the global strategy obtained onto the non-anticipatory subspace. Independent solves are distributed on available workers.
RandomizedProgressiveHedging.randasync_init_workers
— Functionrandasync_init_workers(pb::Problem{T}, subpbparams::AbstractDict) where T<:AbstractScenario
Launch asyncpar_remote_func
in every available worker with correct channels, and pass subpbparams
to each worker.
RandomizedProgressiveHedging.randasync_terminate_workers
— Functionrandasync_terminate_workers(pb, work_channel, remotecalls_futures)
Send a signal so that all workers return and wait that all workers do.
Projections
RandomizedProgressiveHedging.get_averagedtraj
— Functionaveraged_traj = get_averagedtraj(pb::Problem, z::Matrix{Float64}, id_scen::ScenarioId)
Compute and return the averaged trajectory defined by scenario id_scen
over strategy z
.
RandomizedProgressiveHedging.get_averagedtraj!
— Functionget_averagedtraj!(averaged_traj::Vector{Float64}, pb::Problem, z::Matrix, id_scen::ScenarioId)
Compute inplace in averaged_traj
the averaged trajectory defined by scenario id_scen
over strategy z
. Note: this function has been fairly optimized. Apply changes with caution.
RandomizedProgressiveHedging.nonanticipatory_projection
— Functionx = nonanticipatory_projection(pb::Problem, y::Matrix{Float64})
Compute the projection x
of y
on the non-anticipatory subspace associated to problem pb
.
RandomizedProgressiveHedging.nonanticipatory_projection!
— Functionnonanticipatory_projection!(x::Matrix{Float64}, pb::Problem, y::Matrix{Float64})
Store in x
the projection of y
on the non-anticipatory subspace associated to problem pb
. Note: this function has been fairly optimized. Apply changes with caution.
Others
RandomizedProgressiveHedging.get_neighbydepth
— Functionget_neighbydepth(tree::STreeNode, scenid::ScenarioId)
Compute the leaves neighbooring scenid
per level.
RandomizedProgressiveHedging.get_scenariodim
— Functionget_scenariodim(pb::Problem)
Return the dimension of the vector representing a scenario.
LinearAlgebra.dot
— Functiondot(pb::Problem, x::Matrix{Float64}, y::Matrix{Float64})
Compute the weighted scalar product between strategies x
and y
.