GAMS  1.4.0
gams::auctions Namespace Reference

Provides mechanisms for distributed auctions. More...

Classes

class  AuctionBase
 Base class for an auction. More...
 
class  AuctionBid
 Auction bidding instance. More...
 
class  AuctionBidAscending
 Comparator for sorting bids in ascending order(least to greatest) More...
 
class  AuctionBidDescending
 Comparator for sorting bids in descending order(greater to least) More...
 
class  AuctionFactory
 Base class for an auction factory. More...
 
class  AuctionFactoryRepository
 A repository for auction factories. More...
 
class  AuctionMaximumBid
 An auction where the winner is the highest bidder. More...
 
class  AuctionMaximumBidFactory
 Factory for creating maximum-bid auctions. More...
 
class  AuctionMinimumBid
 An auction where the winner is the lowest bidder. More...
 
class  AuctionMinimumBidFactory
 Factory for creating minimum-bid auctions. More...
 
class  AuctionMinimumDistance
 An auction where the winner is the closest agent to a location. More...
 
class  AuctionMinimumDistanceFactory
 Factory for creating minimum-bid auctions. More...
 

Typedefs

typedef std::vector< AuctionBidAuctionBids
 convenience typedef for vector fo AuctionBid More...
 
typedef std::map< AuctionType, AuctionFactory * > AuctionFactoryMap
 Convenience typedef for a map of types to factories. More...
 
typedef madara::knowledge::KnowledgeRecord::Integer AuctionType
 convenience typedef for AuctionType More...
 

Enumerations

enum  AuctionTypes { AUCTION_MAXIMUM_BID = 0 , AUCTION_MINIMUM_BID = 1 , NUM_AUCTION_TYPES = 2 }
 Known group types. More...
 

Functions

void sort_ascending (AuctionBids &bids)
 Convenience function for sorting bids in ascending order, using the AuctionBidAscending comparator. More...
 
void sort_descending (AuctionBids &bids)
 Convenience function for sorting bids in descending order, using the AuctionBidDescending comparator. More...
 
void strip_prefix_fast (const std::string &prefix, AuctionBids &bids)
 Strips bids' bidder of an auction prefix for convenience(unsafe). More...
 
void strip_prefix_safe (const std::string &prefix, AuctionBids &bids)
 Strips bids' bidder of an auction prefix for convenience. More...
 

Detailed Description

Provides mechanisms for distributed auctions.

Typedef Documentation

◆ AuctionBids

convenience typedef for vector fo AuctionBid

Definition at line 126 of file AuctionBid.h.

◆ AuctionFactoryMap

Convenience typedef for a map of types to factories.

Definition at line 71 of file AuctionFactoryRepository.h.

◆ AuctionType

typedef madara::knowledge::KnowledgeRecord::Integer gams::auctions::AuctionType

convenience typedef for AuctionType

Definition at line 81 of file AuctionTypesEnum.h.

Enumeration Type Documentation

◆ AuctionTypes

Known group types.

Enumerator
AUCTION_MAXIMUM_BID 
AUCTION_MINIMUM_BID 
NUM_AUCTION_TYPES 

Definition at line 72 of file AuctionTypesEnum.h.

Function Documentation

◆ sort_ascending()

void gams::auctions::sort_ascending ( AuctionBids bids)

Convenience function for sorting bids in ascending order, using the AuctionBidAscending comparator.

Parameters
bidsthe bids to sort

◆ sort_descending()

void gams::auctions::sort_descending ( AuctionBids bids)

Convenience function for sorting bids in descending order, using the AuctionBidDescending comparator.

Parameters
bidsthe bids to sort

◆ strip_prefix_fast()

void gams::auctions::strip_prefix_fast ( const std::string &  prefix,
AuctionBids bids 
)

Strips bids' bidder of an auction prefix for convenience(unsafe).

This is highly optimized for common usage where the prefix is obtained using get_auction_round_prefix and the prefix is assumed to exist in each auction bidder. This should never be called twice on the same bids, and if you are calling this on the wrong prefix, you may get weird results. Essentially, this is using std::string::erase with 0-prefix.size().

Parameters
prefixthe result of calling get_auction_round_prefix on AuctionBase
bidsthe bids to modify

◆ strip_prefix_safe()

void gams::auctions::strip_prefix_safe ( const std::string &  prefix,
AuctionBids bids 
)

Strips bids' bidder of an auction prefix for convenience.

This method checks for the existence of the prefix on the bidder string before trying to strip it.

Parameters
prefixthe result of calling get_auction_round_prefix on AuctionBase
bidsthe bids to modify