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> struct Trade {
18 double amt;
19 double price;
20
21 Trade() : amt(0), price(0) {}
22
25};
26
27/// @brief Trade-Trade equality operator
28template <class T>
29bool operator==(const cyclus::Trade<T>& lhs, const cyclus::Trade<T>& rhs) {
30 return ((lhs.request == rhs.request) && (lhs.bid == rhs.bid) &&
31 (lhs.price == rhs.price) && (lhs.amt == rhs.amt));
32}
33
34} // namespace cyclus
35
36#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.
A Trade is a simple container that associates a request for a resource with a bid for that resource.
Definition trade.h:15
double price
Definition trade.h:19
Bid< T > * bid
Definition trade.h:17
Trade(Request< T > *request, Bid< T > *bid, double amt)
Definition trade.h:23
Request< T > * request
Definition trade.h:16
double amt
Definition trade.h:18