CYCLUS
|
The ExchangeContext is designed to provide an ease-of-use interface for querying and reaggregating information regarding requests and bids of a resource exchange.
The ExchangeContext is used by a ResourceExchange or related class to provide introspection into the requests and bids it collects. Specifically, this class is designed to assist in phases of the Dynamic Resource Exchange. The second phase, Response to Request for Bids, is assisted by grouping requests by commodity type. The third phase, preference adjustment, is assisted by grouping bids by the requester being responded to.
Definition at line 50 of file exchange_context.h.
#include <exchange_context.h>
Public Member Functions | |
void | AddBid (Bid< T > *pb) |
void | AddBidPortfolio (const typename BidPortfolio< T >::Ptr port) |
void | AddRequest (Request< T > *pr) |
void | AddRequestPortfolio (const typename RequestPortfolio< T >::Ptr port) |
Public Attributes | |
std::set< Trader * > | bidders |
std::vector< typename BidPortfolio< T >::Ptr > | bids |
std::map< Request< T > *, std::vector< Bid< T > * > > | bids_by_request |
CommodMap< T >::type | commod_requests |
std::set< Trader * > | requesters |
std::vector< typename RequestPortfolio< T >::Ptr > | requests |
std::map< Trader *, typename PrefMap< T >::type > | trader_prefs |
adds a bid to the appropriate containers, default trade preference between request and bid is set
pb | the bid |
Definition at line 86 of file exchange_context.h.
|
inline |
adds a bid to the context
Definition at line 72 of file exchange_context.h.
Adds an individual request.
Definition at line 65 of file exchange_context.h.
|
inline |
adds a request to the context
Definition at line 53 of file exchange_context.h.
std::set<Trader*> cyclus::ExchangeContext< T >::bidders |
known bidders
Definition at line 107 of file exchange_context.h.
std::vector<typename BidPortfolio<T>::Ptr> cyclus::ExchangeContext< T >::bids |
a reference to an exchange's set of bids
Definition at line 101 of file exchange_context.h.
maps request to all bids for request
Definition at line 114 of file exchange_context.h.
maps commodity name to requests for that commodity
Definition at line 110 of file exchange_context.h.
std::set<Trader*> cyclus::ExchangeContext< T >::requesters |
known requesters
Definition at line 104 of file exchange_context.h.
std::vector<typename RequestPortfolio<T>::Ptr> cyclus::ExchangeContext< T >::requests |
a reference to an exchange's set of requests
Definition at line 98 of file exchange_context.h.
maps commodity name to requests for that commodity
Definition at line 117 of file exchange_context.h.