1 #ifndef CYCLUS_SRC_BID_H_ 2 #define CYCLUS_SRC_BID_H_ 4 #include <boost/shared_ptr.hpp> 5 #include <boost/weak_ptr.hpp> 20 template <
class T>
class Bid {
56 std::numeric_limits<double>::quiet_NaN());
70 std::numeric_limits<double>::quiet_NaN());
77 inline boost::shared_ptr<T>
offer()
const {
return offer_; }
86 inline bool exclusive()
const {
return exclusive_; }
98 exclusive_(exclusive),
99 preference_(preference) {}
102 bool exclusive =
false)
106 exclusive_(exclusive),
107 preference_(std::numeric_limits<double>::quiet_NaN()) {}
114 portfolio_(portfolio),
115 exclusive_(exclusive),
116 preference_(preference) {}
123 portfolio_(portfolio),
124 exclusive_(exclusive),
125 preference_(std::numeric_limits<double>::quiet_NaN()) {}
128 boost::shared_ptr<T> offer_;
130 boost::weak_ptr<BidPortfolio<T>> portfolio_;
136 #endif // CYCLUS_SRC_BID_H_ boost::shared_ptr< BidPortfolio< T > > Ptr
static Bid< T > * Create(Request< T > *request, boost::shared_ptr< T > offer, Trader *bidder, bool exclusive=false)
a factory method for a bid for a bid without a portfolio
A simple API for agents that wish to exchange resources in the simulation.
boost::shared_ptr< T > offer() const
BidPortfolio< T >::Ptr portfolio()
A Bid encapsulates all the information required to communicate a bid response to a request for a reso...
static Bid< T > * Create(Request< T > *request, boost::shared_ptr< T > offer, Trader *bidder, typename BidPortfolio< T >::Ptr portfolio, bool exclusive=false)
a factory method for a bid
A BidPortfolio is a collection of bids as responses to requests for resources and associated constrai...
static Bid< T > * Create(Request< T > *request, boost::shared_ptr< T > offer, Trader *bidder, bool exclusive, double preference)
a factory method for a bid for a bid without a portfolio
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Request< T > * request() const
static Bid< T > * Create(Request< T > *request, boost::shared_ptr< T > offer, Trader *bidder, typename BidPortfolio< T >::Ptr portfolio, bool exclusive, double preference)
a factory method for a bid
double preference() const
A Request encapsulates all the information required to communicate the needs of an agent in the Dynam...