CYCLUS
Public Member Functions | Public Attributes | List of all members
cyclus::ExchangeContext< T > Class Template Reference

Detailed Description

template<class T>
class cyclus::ExchangeContext< T >

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
 

Member Function Documentation

◆ AddBid()

template<class T>
void cyclus::ExchangeContext< T >::AddBid ( Bid< T > *  pb)
inline

adds a bid to the appropriate containers, default trade preference between request and bid is set

Parameters
pbthe bid

Definition at line 86 of file exchange_context.h.

◆ AddBidPortfolio()

template<class T>
void cyclus::ExchangeContext< T >::AddBidPortfolio ( const typename BidPortfolio< T >::Ptr  port)
inline

adds a bid to the context

Definition at line 72 of file exchange_context.h.

◆ AddRequest()

template<class T>
void cyclus::ExchangeContext< T >::AddRequest ( Request< T > *  pr)
inline

Adds an individual request.

Definition at line 65 of file exchange_context.h.

◆ AddRequestPortfolio()

template<class T>
void cyclus::ExchangeContext< T >::AddRequestPortfolio ( const typename RequestPortfolio< T >::Ptr  port)
inline

adds a request to the context

Definition at line 53 of file exchange_context.h.

Member Data Documentation

◆ bidders

template<class T>
std::set<Trader*> cyclus::ExchangeContext< T >::bidders

known bidders

Definition at line 107 of file exchange_context.h.

◆ bids

template<class T>
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.

◆ bids_by_request

template<class T>
std::map< Request<T>*, std::vector<Bid<T>*> > cyclus::ExchangeContext< T >::bids_by_request

maps request to all bids for request

Definition at line 114 of file exchange_context.h.

◆ commod_requests

template<class T>
CommodMap<T>::type cyclus::ExchangeContext< T >::commod_requests

maps commodity name to requests for that commodity

Definition at line 110 of file exchange_context.h.

◆ requesters

template<class T>
std::set<Trader*> cyclus::ExchangeContext< T >::requesters

known requesters

Definition at line 104 of file exchange_context.h.

◆ requests

template<class T>
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.

◆ trader_prefs

template<class T>
std::map<Trader*, typename PrefMap<T>::type> cyclus::ExchangeContext< T >::trader_prefs

maps commodity name to requests for that commodity

Definition at line 117 of file exchange_context.h.


The documentation for this class was generated from the following file: