CYCLUS
Loading...
Searching...
No Matches
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
7namespace 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.
15template <class T>
16struct Trade {
19 double amt;
20 double price;
21
22 Trade() : amt(0), price(0) {}
23
26 bid(bid),
27 amt(amt),
28 price(0) {}
29};
30
31/// @brief Trade-Trade equality operator
32template<class T>
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_
A Bid encapsulates all the information required to communicate a bid response to a request for a reso...
Definition bid.h:21
A Request encapsulates all the information required to communicate the needs of an agent in the Dynam...
Definition request.h:29
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
bool operator==(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint equality operator.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
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
Bid< T > * bid
Definition trade.h:18
Trade(Request< T > *request, Bid< T > *bid, double amt)
Definition trade.h:24
Request< T > * request
Definition trade.h:17
double amt
Definition trade.h:19