Public Member Functions | List of all members
cyclus::ExchangeTranslator< T > Class Template Reference

Detailed Description

template<class T>
class cyclus::ExchangeTranslator< T >

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 ()
const ExchangeTranslationContext< T > & translation_ctx () const
ExchangeTranslationContext< T > & translation_ctx ()

Constructor & Destructor Documentation

template<class T >
cyclus::ExchangeTranslator< T >::ExchangeTranslator ( ExchangeContext< T > *  ex_ctx)

default constructor

ex_ctxthe exchance context

Definition at line 38 of file exchange_translator.h.

Member Function Documentation

template<class T >
void cyclus::ExchangeTranslator< T >::AddArc ( Request< T > *  req,
Bid< T > *  bid,
ExchangeGraph::Ptr  graph 

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.

template<class T >
void cyclus::ExchangeTranslator< T >::BackTranslateSolution ( const std::vector< Match > &  matches,
std::vector< Trade< T > > &  ret 

Provide a vector of Trades given a vector of Matches.

Definition at line 110 of file exchange_translator.h.

template<class T >
ExchangeGraph::Ptr cyclus::ExchangeTranslator< T >::Translate ( )

translate the ExchangeContext into an ExchangeGraph

Definition at line 43 of file exchange_translator.h.

template<class T >
const ExchangeTranslationContext<T>& cyclus::ExchangeTranslator< T >::translation_ctx ( ) const

Definition at line 120 of file exchange_translator.h.

template<class T >
ExchangeTranslationContext<T>& cyclus::ExchangeTranslator< T >::translation_ctx ( )

Definition at line 124 of file exchange_translator.h.

The documentation for this class was generated from the following file: