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

Safe HaskellNone
LanguageHaskell2010

ProductMixAuction.BudgetConstraints.Types

Contents

Description

Core types for budget constrained PMA auctions

Synopsis

Core types

data AuctionKind Source #

Instances

Bounded AuctionKind Source # 
Enum AuctionKind Source # 
Eq AuctionKind Source # 
Show AuctionKind Source # 
Generic AuctionKind Source # 

Associated Types

type Rep AuctionKind :: * -> * #

ToJSON AuctionKind Source # 

Methods

toJSON :: AuctionKind -> Value

toEncoding :: AuctionKind -> Encoding

toJSONList :: [AuctionKind] -> Value

toEncodingList :: [AuctionKind] -> Encoding

FromJSON AuctionKind Source # 

Methods

parseJSON :: Value -> Parser AuctionKind

parseJSONList :: Value -> Parser [AuctionKind]

Default AuctionKind Source # 

Methods

def :: AuctionKind

Arbitrary AuctionKind Source # 
type Rep AuctionKind Source # 
type Rep AuctionKind = D1 (MetaData "AuctionKind" "ProductMixAuction.BudgetConstraints.Types" "product-mix-auction-0.1.0.0-inplace" False) ((:+:) (C1 (MetaCons "Standard" PrefixI False) U1) (C1 (MetaCons "BudgetConstrained" PrefixI False) U1))

type Good = Int Source #

Goods are identified by non-negative integers (with 0 being the first good).

type Dimension = Int Source #

The number of goods must be a positive integer.

newtype Price Source #

Constructors

Price 

Fields

Instances

Eq Price Source # 

Methods

(==) :: Price -> Price -> Bool #

(/=) :: Price -> Price -> Bool #

Floating Price Source # 
Fractional Price Source # 
Num Price Source # 
Ord Price Source # 

Methods

compare :: Price -> Price -> Ordering #

(<) :: Price -> Price -> Bool #

(<=) :: Price -> Price -> Bool #

(>) :: Price -> Price -> Bool #

(>=) :: Price -> Price -> Bool #

max :: Price -> Price -> Price #

min :: Price -> Price -> Price #

Real Price Source # 

Methods

toRational :: Price -> Rational #

RealFloat Price Source # 
RealFrac Price Source # 

Methods

properFraction :: Integral b => Price -> (b, Price) #

truncate :: Integral b => Price -> b #

round :: Integral b => Price -> b #

ceiling :: Integral b => Price -> b #

floor :: Integral b => Price -> b #

Show Price Source # 

Methods

showsPrec :: Int -> Price -> ShowS #

show :: Price -> String #

showList :: [Price] -> ShowS #

Generic Price Source # 

Associated Types

type Rep Price :: * -> * #

Methods

from :: Price -> Rep Price x #

to :: Rep Price x -> Price #

NFData Price Source # 

Methods

rnf :: Price -> () #

ToJSON Price Source # 

Methods

toJSON :: Price -> Value

toEncoding :: Price -> Encoding

toJSONList :: [Price] -> Value

toEncodingList :: [Price] -> Encoding

FromJSON Price Source # 

Methods

parseJSON :: Value -> Parser Price

parseJSONList :: Value -> Parser [Price]

ToField Price Source # 

Methods

toField :: Price -> Field

FromField Price Source # 

Methods

parseField :: Field -> Parser Price

Default Price Source # 

Methods

def :: Price

Random Price Source # 

Methods

randomR :: RandomGen g => (Price, Price) -> g -> (Price, g)

random :: RandomGen g => g -> (Price, g)

randomRs :: RandomGen g => (Price, Price) -> g -> [Price]

randoms :: RandomGen g => g -> [Price]

randomRIO :: (Price, Price) -> IO Price

randomIO :: IO Price

Arbitrary Price Source # 

Methods

arbitrary :: Gen Price

shrink :: Price -> [Price]

type Rep Price Source # 
type Rep Price = D1 (MetaData "Price" "ProductMixAuction.BudgetConstraints.Types" "product-mix-auction-0.1.0.0-inplace" True) (C1 (MetaCons "Price" PrefixI True) (S1 (MetaSel (Just Symbol "_Price") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Double)))

type PriceVector = Vector Price Source #

justGood :: Int -> Good -> Units -> QuantityVector Source #

justGood n good units creates an n-dimensional quantity vector with zeroes everywhere except possibly in the entry for good, which is set to units.

type BidName = Text Source #

newtype Budget Source #

Constructors

Budget 

Fields

Instances

Eq Budget Source # 

Methods

(==) :: Budget -> Budget -> Bool #

(/=) :: Budget -> Budget -> Bool #

Floating Budget Source # 
Fractional Budget Source # 
Num Budget Source # 
Ord Budget Source # 
Real Budget Source # 
RealFloat Budget Source # 
RealFrac Budget Source # 

Methods

properFraction :: Integral b => Budget -> (b, Budget) #

truncate :: Integral b => Budget -> b #

round :: Integral b => Budget -> b #

ceiling :: Integral b => Budget -> b #

floor :: Integral b => Budget -> b #

Show Budget Source # 
Generic Budget Source # 

Associated Types

type Rep Budget :: * -> * #

Methods

from :: Budget -> Rep Budget x #

to :: Rep Budget x -> Budget #

ToJSON Budget Source # 

Methods

toJSON :: Budget -> Value

toEncoding :: Budget -> Encoding

toJSONList :: [Budget] -> Value

toEncodingList :: [Budget] -> Encoding

FromJSON Budget Source # 

Methods

parseJSON :: Value -> Parser Budget

parseJSONList :: Value -> Parser [Budget]

ToField Budget Source # 

Methods

toField :: Budget -> Field

FromField Budget Source # 

Methods

parseField :: Field -> Parser Budget

Default Budget Source # 

Methods

def :: Budget

type Rep Budget Source # 
type Rep Budget = D1 (MetaData "Budget" "ProductMixAuction.BudgetConstraints.Types" "product-mix-auction-0.1.0.0-inplace" True) (C1 (MetaCons "Budget" PrefixI True) (S1 (MetaSel (Just Symbol "_Budget") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Double)))

data Bid b Source #

A budget-constrained bid. Only threshold bids are implemented so far, not price-taking (non-competitive) bids.

Constructors

Bid 

Fields

Instances

Eq b => Eq (Bid b) Source # 

Methods

(==) :: Bid b -> Bid b -> Bool #

(/=) :: Bid b -> Bid b -> Bool #

Show b => Show (Bid b) Source # 

Methods

showsPrec :: Int -> Bid b -> ShowS #

show :: Bid b -> String #

showList :: [Bid b] -> ShowS #

bid_prices :: forall b. Lens' (Bid b) PriceVector Source #

bid_name :: forall b. Lens' (Bid b) BidName Source #

bid_label :: forall b b. Lens (Bid b) (Bid b) b b Source #

bid_budget :: forall b. Lens' (Bid b) Budget Source #

bidPrice :: Good -> Bid b -> Price Source #

Get the price offered for a good by a bid.

type BidAssignments b = Map b QuantityVector Source #

Assignment of good quantities to bids

type SupplyCurveVector = Vector (SupplyCurve Units) Source #

A supply curve per good

data BCException Source #

Exception that the solver may throw

Constructors

DemandTooHigh Units (SupplyCurve Units)

when the solver tries to get the cost of supplying a given quantity of some good but the said quantity exceeds the supply curve's capacity (this is in principle ruled out by the code, but an exception is a good way to signal that this impossible case can in fact happen)

NoBids

when the solver is run on an auction with no bid

NoCandidatePriceVector

when the solver cannot find a single candidate price vector to use for exploring different allocations of quantities

DecreasingSupplyCurve Good

when the solver is run on an auction with a decreasing supply curve for the given good