product-mix-auction-0.1.0.0: A single-round sealed-bid auction for multiple goods

Safe HaskellNone
LanguageHaskell2010

ProductMixAuction.LP.Rationing

Contents

Description

Implements different strategies for rationing (sharing limited quantities of goods between multiple marginal bidders).

Synopsis

Rationing strategies

type RationingStrategy bid = Auction bid -> AuctionResult bid -> IO (Map bid (Map Good Units)) Source #

A rationing strategy takes an auction and the results of solving its LP (in particular, the auction prices), and computes a possibly-fairer allocation of goods. It may not change the prices.

rationNoRationing :: Ord bid => RationingStrategy bid Source #

Rationing strategy A: let the linear programme do what it will do, and don't do anything about it.

The LP solver may make arbitrary choices as to which marginal bids receive goods and which do not. There is no guarantee of fairness between bids, but this is simple and fast.

rationLinearDemand :: Goodly bid => Maybe RationingSteps -> Maybe (Map Good Int) -> RationingStrategy bid Source #

Rationing strategy D: tweak marginal bids to approximate a linear demand around the bid price, then re-run the auction to find adjusted allocations.

rationLinearDemandPreferPairedBids :: Goodly bid => Maybe RationingSteps -> Maybe (Map Good Int) -> RationingStrategy bid Source #

Rationing strategy D(i): tweak multiply-marginal bids to approximate a linear demand around the bid price, re-run the auction to find adjusted allocations, then reallocate to treat equally bids that are marginal on single goods.

This is the default strategy.

First-order representation

data RationingMode Source #

Enumeration of supported choices of rationing strategy.

Instances

Eq RationingMode Source # 
Show RationingMode Source # 
Generic RationingMode Source # 

Associated Types

type Rep RationingMode :: * -> * #

ToJSON RationingMode Source # 

Methods

toJSON :: RationingMode -> Value

toEncoding :: RationingMode -> Encoding

toJSONList :: [RationingMode] -> Value

toEncodingList :: [RationingMode] -> Encoding

FromJSON RationingMode Source # 

Methods

parseJSON :: Value -> Parser RationingMode

parseJSONList :: Value -> Parser [RationingMode]

Default RationingMode Source # 

Methods

def :: RationingMode

type Rep RationingMode Source # 
type Rep RationingMode = D1 (MetaData "RationingMode" "ProductMixAuction.LP.Rationing" "product-mix-auction-0.1.0.0-inplace" False) ((:+:) (C1 (MetaCons "LinearDemandPreferPairedBids" PrefixI False) U1) ((:+:) (C1 (MetaCons "LinearDemand" PrefixI False) U1) (C1 (MetaCons "NoRationing" PrefixI False) U1)))

newtype RationingSteps Source #

Number of steps to use in rationing strategies that use a step-wise approximation of linear demand.

Constructors

RationingSteps 

Fields

Instances

Eq RationingSteps Source # 
Num RationingSteps Source # 
Ord RationingSteps Source # 
Show RationingSteps Source # 
Generic RationingSteps Source # 

Associated Types

type Rep RationingSteps :: * -> * #

ToJSON RationingSteps Source # 

Methods

toJSON :: RationingSteps -> Value

toEncoding :: RationingSteps -> Encoding

toJSONList :: [RationingSteps] -> Value

toEncodingList :: [RationingSteps] -> Encoding

FromJSON RationingSteps Source # 

Methods

parseJSON :: Value -> Parser RationingSteps

parseJSONList :: Value -> Parser [RationingSteps]

Default RationingSteps Source # 
type Rep RationingSteps Source # 
type Rep RationingSteps = D1 (MetaData "RationingSteps" "ProductMixAuction.LP.Rationing" "product-mix-auction-0.1.0.0-inplace" True) (C1 (MetaCons "RationingSteps" PrefixI True) (S1 (MetaSel (Just Symbol "_RationingSteps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

data RationingOptions Source #

First-order representation of a choice of rationing strategy and any required parameters.

Constructors

RationingOptions 

Fields

runRationingOptions :: Goodly bid => RationingOptions -> RationingStrategy bid Source #

Translate the first-order representation into the appropriate rationing strategy.

Summarising allocations

goodAllocations :: ScaleFactor -> Map bid (Map Good Units) -> Map Good Units Source #

Calculate the total allocation to each good, rounded to the appropriate scale. All goods are included.

bidderAllocations :: Ord bidder => ScaleFactor -> Map (bidder, bid) (Map Good Units) -> Map bidder (Map Good Units) Source #

Calculate the total allocation of each good to each bidder, rounded to the appropriate scale. Unsuccessful bidders are excluded from the map.

bidAllocations :: Ord bid => ScaleFactor -> Map bid (Map Good Units) -> Map bid (Map Good Units) Source #

Round the allocations to the appropriate scale and exclude unsuccessful bids from the map.

filterAllocs :: Ord bid => Map bid (Map Good Units) -> Map bid (Map Good Units) Source #

Make sure that every allocation to a bid is non-zero and unsuccessful bids are excluded from the map.

Lenses