CYCLUS
Loading...
Searching...
No Matches
cyclus::ProgTranslator Class Reference

Detailed Description

a helper class to translate a product exchange into a mathematical program.

use as follows:

// given a graph, g, and interface, iface
t->ToProg();
// solve the program via the interface
t->FromProg();
a helper class to translate a product exchange into a mathematical program.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters

Definition at line 38 of file prog_translator.h.

#include <prog_translator.h>

Classes

struct  Context
 

Public Member Functions

const ProgTranslatorContextctx () const
 
void FromProg ()
 
void Populate ()
 
 ProgTranslator (ExchangeGraph *g, OsiSolverInterface *iface)
 
 ProgTranslator (ExchangeGraph *g, OsiSolverInterface *iface, bool exclusive)
 
 ProgTranslator (ExchangeGraph *g, OsiSolverInterface *iface, bool exclusive, double pseudo_cost)
 
 ProgTranslator (ExchangeGraph *g, OsiSolverInterface *iface, double pseudo_cost)
 
void ToProg ()
 
void Translate ()
 

Constructor & Destructor Documentation

◆ ProgTranslator() [1/4]

cyclus::ProgTranslator::ProgTranslator ( ExchangeGraph * g,
OsiSolverInterface * iface )

constructor

Parameters
gthe exchange graph
ifacethe solver interface
exclusivewhether or not to include binary-valued arcs
pseudo_costthe cost to use for faux arcs

Definition at line 16 of file prog_translator.cc.

◆ ProgTranslator() [2/4]

cyclus::ProgTranslator::ProgTranslator ( ExchangeGraph * g,
OsiSolverInterface * iface,
bool exclusive )

Definition at line 24 of file prog_translator.cc.

◆ ProgTranslator() [3/4]

cyclus::ProgTranslator::ProgTranslator ( ExchangeGraph * g,
OsiSolverInterface * iface,
double pseudo_cost )

Definition at line 33 of file prog_translator.cc.

◆ ProgTranslator() [4/4]

cyclus::ProgTranslator::ProgTranslator ( ExchangeGraph * g,
OsiSolverInterface * iface,
bool exclusive,
double pseudo_cost )

Definition at line 42 of file prog_translator.cc.

Member Function Documentation

◆ ctx()

const ProgTranslatorContext & cyclus::ProgTranslator::ctx ( ) const
inline

Definition at line 73 of file prog_translator.h.

◆ FromProg()

void cyclus::ProgTranslator::FromProg ( )

translates solution from iface back into graph matches

Definition at line 219 of file prog_translator.cc.

◆ Populate()

void cyclus::ProgTranslator::Populate ( )

populates the solver interface with values from the translators Context

Definition at line 104 of file prog_translator.cc.

◆ ToProg()

void cyclus::ProgTranslator::ToProg ( )

translates graph into mathematic program via iface.

This method is equivalent to calling Translate(), then Populate().

Definition at line 124 of file prog_translator.cc.

◆ Translate()

void cyclus::ProgTranslator::Translate ( )

translates the graph, filling the translators Context

Definition at line 72 of file prog_translator.cc.


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