CYCLUS
|
A RequestPortfolio is a group of (possibly constrained) requests for resources.
The portfolio contains a grouping of resource requests that may be mutually met by suppliers. These requests may share a common set of constraints. Take, for instance, a facility that needs fuel, of which there are two commodity types, fuelA and fuelB. If some combination of the two suffice the facility's needs, then requests for both would be added to the portfolio along with a capacity constraint.
The ExchangeTranslator will automatically add a mass-based constraint, that accounts for mutual requests, if the portfolio has them. , e.g.,
A default constraint will add unity for normal requests in the portfolio, but will add a weighted coefficient for requests that meet the same mutual demand. For example, if 10 kg of MOX and 9 kg of UOX meet the same demand for fuel, coefficients are added such that a full order of either will determine the demand as "met". In this case, the total demand is 9.5, the MOX order is given a coefficient of 9.5 / 10, and the UOX order is given a coefficient of 9.5 / 9.
Definition at line 86 of file request_portfolio.h.
#include <request_portfolio.h>
Public Types | |
typedef std::function< double(boost::shared_ptr< T >)> | cost_function_t |
typedef boost::shared_ptr< RequestPortfolio< T > > | Ptr |
typedef Request< T > * | request_ptr |
Public Member Functions | |
void | AddConstraint (const CapacityConstraint< T > &c) |
void | AddMutualReqs (const std::vector< Request< T > * > &rs) |
Request< T > * | AddRequest (boost::shared_ptr< T > target, Trader *requester, std::string commodity, double preference, bool exclusive, cost_function_t cost_function) |
Request< T > * | AddRequest (boost::shared_ptr< T > target, Trader *requester, std::string commodity="", double preference=kDefaultPref, bool exclusive=false) |
const std::set< CapacityConstraint< T > > & | constraints () const |
double | qty () const |
Converter< T >::Ptr | qty_converter () |
Trader * | requester () const |
RequestPortfolio () | |
const std::vector< Request< T > * > & | requests () const |
~RequestPortfolio () | |
typedef std::function<double(boost::shared_ptr<T>)> cyclus::RequestPortfolio< T >::cost_function_t |
Definition at line 90 of file request_portfolio.h.
typedef boost::shared_ptr<RequestPortfolio<T> > cyclus::RequestPortfolio< T >::Ptr |
Definition at line 89 of file request_portfolio.h.
Definition at line 91 of file request_portfolio.h.
|
inline |
Definition at line 93 of file request_portfolio.h.
|
inline |
deletes all requests associated with it
Definition at line 96 of file request_portfolio.h.
|
inline |
add a capacity constraint associated with the portfolio, if it doesn't already exist
c | the constraint to add |
Definition at line 167 of file request_portfolio.h.
|
inline |
adds a collection of requests (already having been registered with this portfolio) as multicommodity requests
rs | the collection of requests to add |
Definition at line 150 of file request_portfolio.h.
|
inline |
add a request to the portfolio
target | the target resource associated with this request |
requester | the requester |
commodity | the commodity associated with this request |
preference | the preference associated with this request (relative to others in the portfolio) |
exclusive | a flag denoting that this request must be met exclusively, i.e., in its entirety by a single offer |
cost_function | The cost function that the requester sets so that the bidder may evaluate many potential resources. |
KeyError | if a request is added from a different requester than the original or if the request quantity is different than the original |
Definition at line 116 of file request_portfolio.h.
|
inline |
add a request to the portfolio
target | the target resource associated with this request |
requester | the requester |
commodity | the commodity associated with this request |
preference | the preference associated with this request (relative to others in the portfolio) |
exclusive | a flag denoting that this request must be met exclusively, i.e., in its entirety by a single offer |
KeyError | if a request is added from a different requester than the original or if the request quantity is different than the original |
Definition at line 139 of file request_portfolio.h.
|
inline |
Definition at line 185 of file request_portfolio.h.
|
inline |
, all requests in a portfolio must have the same quantity, which is checked during AddRequest()
Definition at line 179 of file request_portfolio.h.
returns a capacity converter for this portfolios request quantities
Definition at line 190 of file request_portfolio.h.
|
inline |
Definition at line 173 of file request_portfolio.h.
|
inline |
Definition at line 182 of file request_portfolio.h.