Api
OptimalBids
OptimalBids.PowerModelsMarkets
OptimalBids.Market
OptimalBids.PowerModelsMarkets.PowerModelsMarket
OptimalBids.PowerModelsMarkets.add_generator
OptimalBids.PowerModelsMarkets.profit_and_gradient_for_bid!
OptimalBids.build_market
OptimalBids.build_market
OptimalBids.build_market
OptimalBids.build_market
OptimalBids.calculate_profit
OptimalBids.change_bids!
OptimalBids.clear_market!
OptimalBids.clear_market!
OptimalBids.profit_curve!
OptimalBids.profit_for_bid!
PowerModels.instantiate_model
OptimalBids.Market
— TypeMarket
Mutable Structure of a market instance.
OptimalBids.build_market
— Methodbuild_market(::Type{Market}, params...) -> Market
Builds market of type Market using provided parameters (params
).
OptimalBids.calculate_profit
— Methodcalculate_profit(market::Market) -> NamedTuple{(:cleared_volumes, :clearing_prices, :profit), Tuple{Vector{Int}, Vector{Int}, Vector{Int}}}
Retrieves strategic agent's cleared volumes and prices from the market and calculates per bid profit.
OptimalBids.change_bids!
— Methodchange_bids!(market::Market, new_bids::Vector)
Changes strategic agent's bids in the market to new_bids
.
OptimalBids.clear_market!
— Methodclear_market!(market::Market)
Clears the market.
OptimalBids.profit_curve!
— Methodprofit_curve!(market::Market, range_new_bids::Vector{Vector{Any}}) -> Vector{Float64}
Constructs profit curve for bids provided in range_new_bids
.
OptimalBids.profit_for_bid!
— Methodprofit_for_bid!(market::Market, new_bids::Vector{Any}) -> Float64
Calculates overall profit when market is cleared with new_bids
. This function will sequentiall call change_bids!
, clear_market!
and calculate_profit.
PowerModelsMarkets
OptimalBids.PowerModelsMarkets
— ModulePowerModelsMarkets
SubModule that implements interfact with PowerModels.jl
OptimalBids.PowerModelsMarkets.PowerModelsMarket
— TypePowerModelsMarket <: OptimalBids.Market
Energy-Market type that uses PowerModels' OPF to clear the auction.
Arguments:
network_data::Dict
: PowerModels data structure.strategic_generators::Vector{NamedTuple{(:gen_index, :bus_index),Tuple{String,String}}}
: Vector of strategic generators' indexes and their bus indexes.result::Union{Dict,Missing}
: Market clearing result.market_formulation
: Network formulation used in the PowerModels' auction clearing process (i.e. OPF).opf_builder
: PowerModels opf builder.solver
: JuMP optimization solver that should be able to solve the OPF created based on the passedmarket_formulation
.
OptimalBids.PowerModelsMarkets.add_generator
— Methodadd_generator(nw_data::Dict, bus_index::Int) -> String
Adds generator at bus with index bus_index
in grid data (nw_data
), and returns dictionary key for the new generator.
OptimalBids.PowerModelsMarkets.profit_and_gradient_for_bid!
— Methodprofit_and_gradient_for_bid!(market::Market, new_bids::Vector{Any}) -> Float64, Float64
Calculates overall profit when market is cleared with new_bids
and its gradient w.r.t the vector of bids.
OptimalBids.build_market
— MethodOptimalBids.buildmarket( ::Type{PowerModelsMarket}, networkdata, strategicgenerators, solver; marketformulation=DCPPowerModel, opfbuilder=PowerModels.buildopf, assert_consistency=true, )
Creates Energy-Market of type PowerModelsMarket
.
Arguments:
network_data::Dict
: PowerModels data structure.strategic_generators::Vector{NamedTuple{(:gen_index, :bus_index),Tuple{String,String}}}
: Vector of strategic generators' indexes and their bus indexes.result::Union{Dict,Missing}
: Market clearing result.market_formulation
: Network formulation used in the PowerModels' auction clearing process (i.e. OPF).opf_builder
: PowerModels opf builder.solver
: JuMP optimization solver that should be able to solve the OPF created based on the passedmarket_formulation
.assert_consistency=true
: Boolean to force check if strategic generators indexes (instrategic_generators
) reference generators located at the specifiedbus_index
.
OptimalBids.build_market
— MethodOptimalBids.buildmarket( market::Type{PowerModelsMarket}, networkdata::Dict, genindexes::AbstractVector{String}, busindexes::AbstractVector{String}, solver; marketformulation=DCPPowerModel, opfbuilder=PowerModels.build_opf, kwards..., )
Creates Energy-Market of type PowerModelsMarket
.
Arguments:
network_data::Dict
: PowerModels data structure.gen_indexes::AbstractVector{String}
: Vector of strategic generators' indexes.bus_indexes::AbstractVector{String}
: Vector of strategic generators' bus indexes.result::Union{Dict,Missing}
: Market clearing result.market_formulation
: Network formulation used in the PowerModels' auction clearing process (i.e. OPF).opf_builder
: PowerModels opf builder.solver
: JuMP optimization solver that should be able to solve the OPF created based on the passedmarket_formulation
.
OptimalBids.build_market
— MethodOptimalBids.buildmarket( market::Type{PowerModelsMarket}, networkdata::Dict, genindexes::AbstractVector{String}, solver; marketformulation=DCPPowerModel, opfbuilder=PowerModels.buildopf, )
Creates Energy-Market of type PowerModelsMarket
.
Arguments:
network_data::Dict
: PowerModels data structure.gen_indexes::AbstractVector{String}
: Vector of strategic generators' indexes.result::Union{Dict,Missing}
: Market clearing result.market_formulation
: Network formulation used in the PowerModels' auction clearing process (i.e. OPF).opf_builder
: PowerModels opf builder.solver
: JuMP optimization solver that should be able to solve the OPF created based on the passedmarket_formulation
.
OptimalBids.clear_market!
— MethodOptimalBids.clear_market!(market::PowerModelsMarket)
Clears market and stores result's dictionary in result
.
PowerModels.instantiate_model
— MethodPowerModels.instantiate_model(market::PowerModelsMarket)
Instantiates PowerModels Model.