CYCLUS
Loading...
Searching...
No Matches
cyclus::Request< T > Class Template Reference

Detailed Description

template<class T>
class cyclus::Request< T >

A Request encapsulates all the information required to communicate the needs of an agent in the Dynamic Resource Exchange, including the commodity it needs as well as a resource specification for that commodity.

A Request is templated its resource.

Definition at line 29 of file request.h.

#include <request.h>

Public Types

typedef std::function< double(boost::shared_ptr< T >)> cost_function_t
 

Public Member Functions

std::string commodity () const
 
cost_function_t cost_function () const
 
bool exclusive () const
 
RequestPortfolio< T >::Ptr portfolio () const
 
double preference () const
 
Traderrequester () const
 
boost::shared_ptr< Ttarget () const
 

Static Public Member Functions

static Request< T > * Create (boost::shared_ptr< T > target, Trader *requester, std::string commodity, double preference, bool exclusive, cost_function_t cost_function)
 
static Request< T > * Create (boost::shared_ptr< T > target, Trader *requester, std::string commodity="", double preference=kDefaultPref, bool exclusive=false)
 
static Request< T > * Create (boost::shared_ptr< T > target, Trader *requester, typename RequestPortfolio< T >::Ptr portfolio, std::string commodity, double preference, bool exclusive, cost_function_t cost_function)
 
static Request< T > * Create (boost::shared_ptr< T > target, Trader *requester, typename RequestPortfolio< T >::Ptr portfolio, std::string commodity="", double preference=kDefaultPref, bool exclusive=false)
 

Member Typedef Documentation

◆ cost_function_t

template<class T >
typedef std::function<double(boost::shared_ptr<T>)> cyclus::Request< T >::cost_function_t

Definition at line 31 of file request.h.

Member Function Documentation

◆ commodity()

template<class T >
std::string cyclus::Request< T >::commodity ( ) const
inline
Returns
the commodity associated with this request

Definition at line 103 of file request.h.

◆ cost_function()

template<class T >
cost_function_t cyclus::Request< T >::cost_function ( ) const
inline
Returns
the cost function for the request

Definition at line 117 of file request.h.

◆ Create() [1/4]

template<class T >
static Request< T > * cyclus::Request< T >::Create ( boost::shared_ptr< T > target,
Trader * requester,
std::string commodity,
double preference,
bool exclusive,
cost_function_t cost_function )
inlinestatic

a factory method for a bid for a bid without a portfolio

Warning
this factory should generally only be used for testing

Definition at line 77 of file request.h.

◆ Create() [2/4]

template<class T >
static Request< T > * cyclus::Request< T >::Create ( boost::shared_ptr< T > target,
Trader * requester,
std::string commodity = "",
double preference = kDefaultPref,
bool exclusive = false )
inlinestatic

a factory method for a bid for a bid without a portfolio

Warning
this factory should generally only be used for testing

Definition at line 88 of file request.h.

◆ Create() [3/4]

template<class T >
static Request< T > * cyclus::Request< T >::Create ( boost::shared_ptr< T > target,
Trader * requester,
typename RequestPortfolio< T >::Ptr portfolio,
std::string commodity,
double preference,
bool exclusive,
cost_function_t cost_function )
inlinestatic

a factory method for a request

Parameters
targetthe target resource associated with this request
requesterthe requester
portfoliothe porftolio of which this request is a part
commoditythe commodity associated with this request
preferencethe preference associated with this request (relative to others in the portfolio)
exclusivea flag denoting that this request must be met exclusively, i.e., in its entirety by a single offer
cost_functiona standard function object that returns the cost of a potential resource when called.

Definition at line 45 of file request.h.

◆ Create() [4/4]

template<class T >
static Request< T > * cyclus::Request< T >::Create ( boost::shared_ptr< T > target,
Trader * requester,
typename RequestPortfolio< T >::Ptr portfolio,
std::string commodity = "",
double preference = kDefaultPref,
bool exclusive = false )
inlinestatic

a factory method for a request

Parameters
targetthe target resource associated with this request
requesterthe requester
portfoliothe porftolio of which this request is a part
commoditythe commodity associated with this request
preferencethe preference associated with this request (relative to others in the portfolio)
exclusivea flag denoting that this request must be met exclusively, i.e., in its entirety by a single offer

Definition at line 65 of file request.h.

◆ exclusive()

template<class T >
bool cyclus::Request< T >::exclusive ( ) const
inline
Returns
whether or not this an exclusive request

Definition at line 114 of file request.h.

◆ portfolio()

template<class T >
RequestPortfolio< T >::Ptr cyclus::Request< T >::portfolio ( ) const
inline
Returns
the portfolio of which this request is a part

Definition at line 109 of file request.h.

◆ preference()

template<class T >
double cyclus::Request< T >::preference ( ) const
inline
Returns
the preference value for this request

Definition at line 106 of file request.h.

◆ requester()

template<class T >
Trader * cyclus::Request< T >::requester ( ) const
inline
Returns
the requester associated with this request

Definition at line 100 of file request.h.

◆ target()

template<class T >
boost::shared_ptr< T > cyclus::Request< T >::target ( ) const
inline
Returns
this request's target

Definition at line 97 of file request.h.


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