Safe Haskell | None |
---|---|
Language | Haskell2010 |
ProductMixAuction.LP
Description
This is the main module for solving standard Product-Mix Auctions
using linear programming, possibly involving multiple runs of the
LP solver for some features. See Core
for
translating and running basic auctions using a single LP solver
iteration.
- data AuctionInput bid = AuctionInput {
- _ac_supply :: Supply Units
- _ac_bidders :: [Bidder bid]
- _ac_scale :: ScaleFactor
- _ac_tqss :: Maybe (TQSS TQSSTable)
- _ac_demand_curves :: [DemandCurveType]
- _ac_ration :: RationingOptions
- _ac_preferences :: [Good]
- _ac_constraints :: [AdditionalConstraint (BidderName, bid)]
- _ac_verbosity :: Verbosity
- _ac_maximise :: Maximise
- _ac_shuffle :: Shuffle
- data Maximise
- data Shuffle
- mkAuctionInput :: Ord bid => Supply Units -> [Bidder bid] -> Maybe (TQSS TQSSTable) -> AuctionInput bid
- flattenBidders :: [Bidder bid] -> [Bid (BidderName, bid)]
- data AuctionOutput bid = AuctionOutput {
- _ao_prices :: Map Good Price
- _ao_good_allocations :: Map Good Units
- _ao_bidder_allocations :: Map BidderName (Map Good Units)
- _ao_bid_allocations :: Map (BidderName, bid) (Map Good Units)
- _ao_tqss_total_supply :: Maybe Units
- _ao_normalised_price :: Maybe Price
- _ao_tqss_points :: Maybe [TQSSPoint]
- _ao_demand_curves :: Map Good [DemandCurve]
- _ao_profit :: Maybe Price
- runAuction :: Goodly bid => AuctionInput bid -> IO (AuctionOutput bid)
- ac_supply :: forall bid. Lens' (AuctionInput bid) (Supply Units)
- ac_bidders :: forall bid. Lens' (AuctionInput bid) [Bidder bid]
- ac_scale :: forall bid. Lens' (AuctionInput bid) ScaleFactor
- ac_tqss :: forall bid. Lens' (AuctionInput bid) (Maybe (TQSS TQSSTable))
- ac_demand_curves :: forall bid. Lens' (AuctionInput bid) [DemandCurveType]
- ac_ration :: forall bid. Lens' (AuctionInput bid) RationingOptions
- ac_preferences :: forall bid. Lens' (AuctionInput bid) [Good]
- ac_verbosity :: forall bid. Lens' (AuctionInput bid) Verbosity
- ac_maximise :: forall bid. Lens' (AuctionInput bid) Maximise
- ao_prices :: forall bid. Lens' (AuctionOutput bid) (Map Good Price)
- ao_bid_allocations :: forall bid bid. Lens (AuctionOutput bid) (AuctionOutput bid) (Map (BidderName, bid) (Map Good Units)) (Map (BidderName, bid) (Map Good Units))
- ao_bidder_allocations :: forall bid. Lens' (AuctionOutput bid) (Map BidderName (Map Good Units))
- ao_good_allocations :: forall bid. Lens' (AuctionOutput bid) (Map Good Units)
- ao_tqss_total_supply :: forall bid. Lens' (AuctionOutput bid) (Maybe Units)
- ao_normalised_price :: forall bid. Lens' (AuctionOutput bid) (Maybe Price)
- ao_tqss_points :: forall bid. Lens' (AuctionOutput bid) (Maybe [TQSSPoint])
- ao_demand_curves :: forall bid. Lens' (AuctionOutput bid) (Map Good [DemandCurve])
- ao_profit :: forall bid. Lens' (AuctionOutput bid) (Maybe Price)
Inputs
data AuctionInput bid Source #
Inputs for a Product-Mix Auction to be solved using linear
programming. This supports advanced features that may require
multiple iterations of the LP solver, unlike Auction
, which
represents the data provided for a single iteration.
Constructors
AuctionInput | |
Fields
|
Instances
Show bid => Show (AuctionInput bid) Source # | |
Generic (AuctionInput bid) Source # | |
(ToJSONKey bid, ToJSON bid) => ToJSON (AuctionInput bid) Source # | |
(Ord bid, FromJSONKey bid, FromJSON bid) => FromJSON (AuctionInput bid) Source # | |
Default (AuctionInput bid) Source # | |
type Rep (AuctionInput bid) Source # | |
Constructors
MaxEfficiency | A standard LP auction, in which efficiency is maximised |
MaxProfit | An auction in which the auctioneer's profit is maximised, not solved using an LP |
Constructors
NoShuffle | Keep order of bid labels as in input |
ShuffleBids | Randomize the order of bid labels (across all bidders) |
mkAuctionInput :: Ord bid => Supply Units -> [Bidder bid] -> Maybe (TQSS TQSSTable) -> AuctionInput bid Source #
Given a supply of goods and some bidders, create an auction input with sensible defaults.
flattenBidders :: [Bidder bid] -> [Bid (BidderName, bid)] Source #
Flatten a list of bidders to produce a list of bids annotated with the bidder name.
Outputs
data AuctionOutput bid Source #
Outputs from running a Product-Mix Auction.
Constructors
AuctionOutput | |
Fields
|
Instances
Eq bid => Eq (AuctionOutput bid) Source # | |
Show bid => Show (AuctionOutput bid) Source # | |
Generic (AuctionOutput bid) Source # | |
(Ord bid, ToJSONKey bid, ToJSON bid) => ToJSON (AuctionOutput bid) Source # | |
(Ord bid, FromJSONKey bid, FromJSON bid) => FromJSON (AuctionOutput bid) Source # | |
Default (AuctionOutput bid) Source # | |
(Arbitrary bid, Ord bid) => Arbitrary (AuctionOutput bid) Source # | |
type Rep (AuctionOutput bid) Source # | |
Running auctions
runAuction :: Goodly bid => AuctionInput bid -> IO (AuctionOutput bid) Source #
Run a Product-Mix Auction as specified by the inputs, and produce the corresponding outputs.
Lenses
ac_bidders :: forall bid. Lens' (AuctionInput bid) [Bidder bid] Source #
ac_scale :: forall bid. Lens' (AuctionInput bid) ScaleFactor Source #
ac_demand_curves :: forall bid. Lens' (AuctionInput bid) [DemandCurveType] Source #
ac_ration :: forall bid. Lens' (AuctionInput bid) RationingOptions Source #
ac_preferences :: forall bid. Lens' (AuctionInput bid) [Good] Source #
ac_verbosity :: forall bid. Lens' (AuctionInput bid) Verbosity Source #
ac_maximise :: forall bid. Lens' (AuctionInput bid) Maximise Source #
ao_bid_allocations :: forall bid bid. Lens (AuctionOutput bid) (AuctionOutput bid) (Map (BidderName, bid) (Map Good Units)) (Map (BidderName, bid) (Map Good Units)) Source #
ao_bidder_allocations :: forall bid. Lens' (AuctionOutput bid) (Map BidderName (Map Good Units)) Source #
ao_good_allocations :: forall bid. Lens' (AuctionOutput bid) (Map Good Units) Source #
ao_tqss_total_supply :: forall bid. Lens' (AuctionOutput bid) (Maybe Units) Source #
ao_normalised_price :: forall bid. Lens' (AuctionOutput bid) (Maybe Price) Source #
ao_tqss_points :: forall bid. Lens' (AuctionOutput bid) (Maybe [TQSSPoint]) Source #
ao_demand_curves :: forall bid. Lens' (AuctionOutput bid) (Map Good [DemandCurve]) Source #