CYCLUS
trade.h
Go to the documentation of this file.
1 #ifndef CYCLUS_SRC_TRADE_H_
2 #define CYCLUS_SRC_TRADE_H_
3 
4 #include "bid.h"
5 #include "request.h"
6 
7 namespace cyclus {
8 
9 /// @class Trade
10 ///
11 /// @brief A Trade is a simple container that associates a request for a
12 /// resource with a bid for that resource. Additionally, a quantity is assigned
13 /// to the Trade which may be less than either the request or bid
14 /// quantity. Finally, Trades have a price member which is not currently used.
15 template <class T>
16 struct Trade {
19  double amt;
20  double price;
21 
22  Trade() : amt(0), price(0) {}
23 
24  Trade(Request<T>* request, Bid<T>* bid, double amt)
25  : request(request),
26  bid(bid),
27  amt(amt),
28  price(0) {}
29 };
30 
31 /// @brief Trade-Trade equality operator
32 template<class T>
33 bool operator==(const cyclus::Trade<T>& lhs, const cyclus::Trade<T>& rhs) {
34  return ((lhs.request == rhs.request) &&
35  (lhs.bid == rhs.bid) &&
36  (lhs.price == rhs.price) &&
37  (lhs.amt == rhs.amt));
38 }
39 
40 } // namespace cyclus
41 
42 #endif // CYCLUS_SRC_TRADE_H_
Request< T > * request
Definition: trade.h:17
A Bid encapsulates all the information required to communicate a bid response to a request for a reso...
Definition: bid.h:20
double amt
Definition: trade.h:19
Bid< T > * bid
Definition: trade.h:18
Trade(Request< T > *request, Bid< T > *bid, double amt)
Definition: trade.h:24
bool operator==(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint equality operator.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
A Trade is a simple container that associates a request for a resource with a bid for that resource...
Definition: trade.h:16
double price
Definition: trade.h:20
A Request encapsulates all the information required to communicate the needs of an agent in the Dynam...
Definition: request.h:29