GAMS
1.4.0
|
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< AuctionBid > | AuctionBids |
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... | |
Provides mechanisms for distributed auctions.
typedef std::vector<AuctionBid> gams::auctions::AuctionBids |
convenience typedef for vector fo AuctionBid
Definition at line 126 of file AuctionBid.h.
typedef std::map<AuctionType, AuctionFactory *> gams::auctions::AuctionFactoryMap |
Convenience typedef for a map of types to factories.
Definition at line 71 of file AuctionFactoryRepository.h.
typedef madara::knowledge::KnowledgeRecord::Integer gams::auctions::AuctionType |
convenience typedef for AuctionType
Definition at line 81 of file AuctionTypesEnum.h.
Known group types.
Enumerator | |
---|---|
AUCTION_MAXIMUM_BID | |
AUCTION_MINIMUM_BID | |
NUM_AUCTION_TYPES |
Definition at line 72 of file AuctionTypesEnum.h.
void gams::auctions::sort_ascending | ( | AuctionBids & | bids | ) |
Convenience function for sorting bids in ascending order, using the AuctionBidAscending comparator.
bids | the bids to sort |
void gams::auctions::sort_descending | ( | AuctionBids & | bids | ) |
Convenience function for sorting bids in descending order, using the AuctionBidDescending comparator.
bids | the bids to sort |
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().
prefix | the result of calling get_auction_round_prefix on AuctionBase |
bids | the bids to modify |
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.
prefix | the result of calling get_auction_round_prefix on AuctionBase |
bids | the bids to modify |