1#ifndef CYCLUS_SRC_REQUEST_H_
2#define CYCLUS_SRC_REQUEST_H_
8#include <boost/shared_ptr.hpp>
9#include <boost/weak_ptr.hpp>
97 inline boost::shared_ptr<T>
target()
const {
return target_; }
103 inline std::string
commodity()
const {
return commodity_; }
110 return portfolio_.lock();
139 cost_function_(
NULL) {}
162 cost_function_(
NULL) {}
164 boost::shared_ptr<T> target_;
167 std::string commodity_;
168 boost::weak_ptr<RequestPortfolio<T>> portfolio_;
A RequestPortfolio is a group of (possibly constrained) requests for resources.
boost::shared_ptr< RequestPortfolio< T > > Ptr
A Request encapsulates all the information required to communicate the needs of an agent in the Dynam...
static Request< T > * Create(boost::shared_ptr< T > target, Trader *requester, std::string commodity, double preference, bool exclusive, cost_function_t cost_function)
a factory method for a bid for a bid without a portfolio
static Request< T > * Create(boost::shared_ptr< T > target, Trader *requester, std::string commodity="", double preference=kDefaultPref, bool exclusive=false)
a factory method for a bid for a bid without a portfolio
cost_function_t cost_function() const
std::string commodity() const
boost::shared_ptr< T > target() const
std::function< double(boost::shared_ptr< T >)> cost_function_t
double preference() const
RequestPortfolio< T >::Ptr portfolio() const
Trader * requester() const
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)
a factory method for a request
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)
a factory method for a request
A simple API for agents that wish to exchange resources in the simulation.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
static const double kDefaultPref
Default preference values are unity.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters