Safe Haskell | None |
---|---|
Language | Haskell2010 |
ProductMixAuction.LP.Bid
Description
Representation of bids and bidders in LP auctions.
- data Bid bid = Bid {
- _bid_label :: bid
- _bid_name :: Maybe String
- _bid_quantity :: Units
- _bid_values :: Map Good BidValue
- data BidValue = BidValue {}
- mkEmptyBid :: bid -> Bid bid
- mkUnitBid :: bid -> Good -> Price -> Bid bid
- mkSingleBid :: bid -> Good -> Price -> Units -> Bid bid
- mkSymmetricBid :: bid -> Units -> [(Good, Price)] -> Bid bid
- mkAsymmetricBid :: bid -> Units -> [(Good, (TradeOff, Price))] -> Bid bid
- mkGeneralisedBid :: bid -> Units -> [(Good, (Units, Price))] -> Bid bid
- mkAsymmetricGeneralisedBid :: bid -> Units -> [(Good, (TradeOff, Units, Price))] -> Bid bid
- bidName :: Show bid => Bid bid -> String
- bidFraction :: Bid bid -> Good -> TradeOff
- bidQuantityOf :: Bid bid -> Good -> Units
- bidDemandQuantity :: Bid bid -> Good -> Units
- bidValue :: Bid bid -> Good -> TweakedPrice
- isGeneralised :: Bid bid -> Bool
- isAsymmetric :: Bid bid -> Bool
- showBid :: Show bid => Bid bid -> String
- data Bidder bid = Bidder {
- _bidder_name :: BidderName
- _bidder_bids :: [Bid bid]
- bid_label :: forall bid bid. Lens (Bid bid) (Bid bid) bid bid
- bid_name :: forall bid. Lens' (Bid bid) (Maybe String)
- bid_quantity :: forall bid. Lens' (Bid bid) Units
- bid_values :: forall bid. Lens' (Bid bid) (Map Good BidValue)
- bv_fraction :: Lens' BidValue TradeOff
- bv_quantity :: Lens' BidValue Units
- bv_price :: Lens' BidValue TweakedPrice
- bidder_name :: forall bid. Lens' (Bidder bid) BidderName
- bidder_bids :: forall bid bid. Lens (Bidder bid) (Bidder bid) [Bid bid] [Bid bid]
Representation types
Represents a potentially-paired bid on an arbitrary number of goods.
Constructors
Bid | |
Fields
|
The data stored for each good by a bid.
Constructors
BidValue | |
Fields
|
Smart constructors
mkEmptyBid :: bid -> Bid bid Source #
The zero bid for no goods.
mkSingleBid :: bid -> Good -> Price -> Units -> Bid bid Source #
Make a non-paired bid, i.e. a simple bid on a single good.
mkSymmetricBid :: bid -> Units -> [(Good, Price)] -> Bid bid Source #
Make a symmetric bid on multiple goods with varying prices, but with a constant number of units.
mkAsymmetricBid :: bid -> Units -> [(Good, (TradeOff, Price))] -> Bid bid Source #
Make an asymmetric bid on multiple goods, where the quantity requested and the denominator of the fraction of quantity for each good are specified explicitly.
mkGeneralisedBid :: bid -> Units -> [(Good, (Units, Price))] -> Bid bid Source #
Make a symmetric generalised bid, which differentiates the number
of units requested for each good (kappa^i_j
) from the total
number of units requested (k_i
). Note that kappa^i_j
must be
less than or equal to k_i
.
mkAsymmetricGeneralisedBid :: bid -> Units -> [(Good, (TradeOff, Units, Price))] -> Bid bid Source #
Make an asymmetric, generalised bid, which differentiates the
number of units requested for each good (kappa^i_j
) from the
total number of units requested (k_i
). Note that kappa^i_j
must be less than or equal to k_i
. The trade-off coefficient for
each good (a^i_j
) must be specified explicitly.
Properties of bids
bidName :: Show bid => Bid bid -> String Source #
An identifying name for this bid, which might be explicitly specified or derived from the label.
bidFraction :: Bid bid -> Good -> TradeOff Source #
Look up the denominator of the fraction of the total quantity that applies to this good (i.e. a_ij).
bidQuantityOf :: Bid bid -> Good -> Units Source #
Look up the quantity of a particular good requested by a bid
(i.e. kappa^i_j
).
bidDemandQuantity :: Bid bid -> Good -> Units Source #
The quantity of this good demanded by this bid, adjusted for asymmetric bids, and ignoring bidding on other goods.
bidValue :: Bid bid -> Good -> TweakedPrice Source #
Look up the price bid for a particular good (i.e. v^i_j
).
isGeneralised :: Bid bid -> Bool Source #
Is this a generalised paired bid? (That is, is there a good for which the maximum quantity is less than the maximum quantity for the entire bid?)
isAsymmetric :: Bid bid -> Bool Source #
Is this an asymmetric bid? (That is, is there a good for which the trade-off coefficient is not 1?)
Bidders
A bidder is essentially just a collection of bids, as far as the program is concerned, associated together for reasons of presentation.
Constructors
Bidder | |
Fields
|
Lenses
bid_quantity :: forall bid. Lens' (Bid bid) Units Source #
bv_fraction :: Lens' BidValue TradeOff Source #
bv_quantity :: Lens' BidValue Units Source #
bv_price :: Lens' BidValue TweakedPrice Source #
bidder_name :: forall bid. Lens' (Bidder bid) BidderName Source #