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

Safe HaskellNone
LanguageHaskell2010

ProductMixAuction.LP.AdditionalConstraint

Contents

Description

Representation of additional constraints imposed on bids.

Synopsis

Documentation

data AdditionalConstraint bid Source #

Represents an additional linear constraint on the bids. These are always of the form

sum_{i,j} c^i_j x^i_j <= C R + C'

for some coefficients c^i_j >= 0 and constants C, C' >= 0. Here x^i_j is the amount of good j allocated to bid i, and R is the total size of the auction supply.

Constructors

AdditionalConstraint 

Fields

Instances

Show bid => Show (AdditionalConstraint bid) Source # 
Generic (AdditionalConstraint bid) Source # 

Associated Types

type Rep (AdditionalConstraint bid) :: * -> * #

ToJSONKey bid => ToJSON (AdditionalConstraint bid) Source # 

Methods

toJSON :: AdditionalConstraint bid -> Value

toEncoding :: AdditionalConstraint bid -> Encoding

toJSONList :: [AdditionalConstraint bid] -> Value

toEncodingList :: [AdditionalConstraint bid] -> Encoding

(FromJSONKey bid, Ord bid) => FromJSON (AdditionalConstraint bid) Source # 

Methods

parseJSON :: Value -> Parser (AdditionalConstraint bid)

parseJSONList :: Value -> Parser [AdditionalConstraint bid]

Default (AdditionalConstraint bid) Source # 
type Rep (AdditionalConstraint bid) Source # 
type Rep (AdditionalConstraint bid) = D1 (MetaData "AdditionalConstraint" "ProductMixAuction.LP.AdditionalConstraint" "product-mix-auction-0.1.0.0-inplace" False) (C1 (MetaCons "AdditionalConstraint" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ac_coefficients") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map bid (Map Good Double)))) ((:*:) (S1 (MetaSel (Just Symbol "_ac_c") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Ratio)) (S1 (MetaSel (Just Symbol "_ac_c'") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Double)))))

mkAbsoluteQuantityConstraint :: Ord bid => [Good] -> [bid] -> Units -> AdditionalConstraint bid Source #

Make a constraint on the quantity allocated to the given bids, across the given goods. If all goods are listed, this is essentially equivalent to reducing the _bid_quantity for the bids.

mkRelativeQuantityConstraint :: Ord bid => [Good] -> [bid] -> Ratio -> AdditionalConstraint bid Source #

Make a constraint on the quantity allocated to the given bids, across the given goods, as a fraction of the total auction size.

showConstraint :: Show bid => AdditionalConstraint bid -> String Source #

Render an additional constraint as a human-readable string.

mapConstraint :: Ord bid' => (bid -> bid') -> AdditionalConstraint bid -> AdditionalConstraint bid' Source #

Change the representation of bid labels in an additional constraint. Requires the codomain to have an Ord instance, hence not a Functor.

Lenses

ac_c :: forall bid. Lens' (AdditionalConstraint bid) Ratio Source #

ac_c' :: forall bid. Lens' (AdditionalConstraint bid) Double Source #

ac_coefficients :: forall bid bid. Lens (AdditionalConstraint bid) (AdditionalConstraint bid) (Map bid (Map Good Double)) (Map bid (Map Good Double)) Source #