CYCLUS
Loading...
Searching...
No Matches
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 ()
 
ExchangeTranslationContext< T > & translation_ctx ()
 
const ExchangeTranslationContext< T > & translation_ctx () const
 

Constructor & Destructor Documentation

◆ ExchangeTranslator()

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

default constructor

Parameters
ex_ctxthe exchance context

Definition at line 38 of file exchange_translator.h.

Member Function Documentation

◆ AddArc()

template<class T >
void cyclus::ExchangeTranslator< T >::AddArc ( Request< T > * req,
Bid< T > * bid,
ExchangeGraph::Ptr graph )
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.

◆ BackTranslateSolution()

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

Provide a vector of Trades given a vector of Matches.

Definition at line 110 of file exchange_translator.h.

◆ Translate()

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

translate the ExchangeContext into an ExchangeGraph

Definition at line 43 of file exchange_translator.h.

◆ translation_ctx() [1/2]

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

Definition at line 124 of file exchange_translator.h.

◆ translation_ctx() [2/2]

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

Definition at line 120 of file exchange_translator.h.


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