1#ifndef CYCLUS_SRC_TRADER_MANAGEMENT_H_
2#define CYCLUS_SRC_TRADER_MANAGEMENT_H_
14inline static std::set<typename RequestPortfolio<T>::Ptr>
16 throw StateError(
"Non-specialized version of QueryRequests not supported");
20inline std::set<RequestPortfolio<Material>::Ptr>
22 return t->GetMatlRequests();
26inline std::set<RequestPortfolio<Product>::Ptr>
28 return t->GetProductRequests();
32inline static std::set<typename BidPortfolio<T>::Ptr>
34 throw StateError(
"Non-specialized version of QueryBids not supported");
38inline std::set<BidPortfolio<Material>::Ptr>
40 return t->GetMatlBids(
map);
44inline std::set<BidPortfolio<Product>::Ptr>
46 return t->GetProductBids(
map);
55 "PopulateTradeResponses not supported");
78 throw StateError(
"Non-specialized version of AcceptTrades not supported");
boost::shared_ptr< Material > Ptr
boost::shared_ptr< Product > Ptr
For failed object state expectations.
A simple API for agents that wish to exchange resources in the simulation.
virtual void GetProductTrades(const std::vector< Trade< Product > > &trades, std::vector< std::pair< Trade< Product >, Product::Ptr > > &responses)
default implementation for responding to product trades
virtual void AcceptProductTrades(const std::vector< std::pair< Trade< Product >, Product::Ptr > > &responses)
default implementation for product trade acceptance
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
static std::set< typename BidPortfolio< T >::Ptr > QueryBids(Trader *t, typename CommodMap< T >::type &map)
std::set< RequestPortfolio< Material >::Ptr > QueryRequests< Material >(Trader *t)
std::set< RequestPortfolio< Product >::Ptr > QueryRequests< Product >(Trader *t)
static void PopulateTradeResponses(Trader *trader, const std::vector< Trade< T > > &trades, std::vector< std::pair< Trade< T >, typename T::Ptr > > &responses)
static void AcceptTrades(Trader *trader, const std::vector< std::pair< Trade< T >, typename T::Ptr > > &responses)
std::set< BidPortfolio< Material >::Ptr > QueryBids< Material >(Trader *t, CommodMap< Material >::type &map)
void PopulateTradeResponses< Material >(Trader *trader, const std::vector< Trade< Material > > &trades, std::vector< std::pair< Trade< Material >, Material::Ptr > > &responses)
void PopulateTradeResponses< Product >(Trader *trader, const std::vector< Trade< Product > > &trades, std::vector< std::pair< Trade< Product >, Product::Ptr > > &responses)
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
static std::set< typename RequestPortfolio< T >::Ptr > QueryRequests(Trader *t)
std::set< BidPortfolio< Product >::Ptr > QueryBids< Product >(Trader *t, CommodMap< Product >::type &map)
std::map< std::string, std::vector< Request< T > * > > type
A Trade is a simple container that associates a request for a resource with a bid for that resource.