CYCLUS
|
An ExchangeTranslator facilitates translation from a resource specific exchange to a resource-neutral exchange, upon which generic solvers can be applied.
Specifically, the ExchangeTranslator constructor takes a resource-specific exchange context and provides a Translate() method to make a resource-neutral ExchangeGraph. State is maintained in the ExchangeTranslator class, mapping Requests and Bids to ExchangeNodes in the ExchangeGraph. Accordingly, the solution to the ExchangeGraph, i.e., it's Matches, can be back-translated to the original Requests and Bids via a BackTranslateSolution() method.
Definition at line 33 of file exchange_translator.h.
#include <exchange_translator.h>
Public Member Functions | |
void | AddArc (Request< T > *req, Bid< T > *bid, ExchangeGraph::Ptr graph) |
void | BackTranslateSolution (const std::vector< Match > &matches, std::vector< Trade< T > > &ret) |
ExchangeTranslator (ExchangeContext< T > *ex_ctx) | |
ExchangeGraph::Ptr | Translate () |
ExchangeTranslationContext< T > & | translation_ctx () |
const ExchangeTranslationContext< T > & | translation_ctx () const |
|
inline |
default constructor
ex_ctx | the exchance context |
Definition at line 38 of file exchange_translator.h.
|
inline |
adds a bid-request arc to a graph, if the preference for the arc is non-negative
Definition at line 81 of file exchange_translator.h.
|
inline |
Provide a vector of Trades given a vector of Matches.
Definition at line 110 of file exchange_translator.h.
|
inline |
translate the ExchangeContext into an ExchangeGraph
Definition at line 43 of file exchange_translator.h.
|
inline |
Definition at line 124 of file exchange_translator.h.
|
inline |
Definition at line 120 of file exchange_translator.h.