CYCLUS

The GreedySolver provides the implementation for a "greedy" solution to a resource exchange graph.
Given an ExchangeGraph, the greedy solver will march through each RequestGroup in the graph, matching request nodes "greedily" with supply nodes. Each request node will attempt to be supplied by supplier arcs as long as those supplier arcs have some excess capacity. The possible suppliers will be ordered by descending preference. The algorithm terminates when one of the following conditions is met: 1) All RequestGroups are satisfied 2) All SupplySets are at capacity
Definition at line 63 of file greedy_solver.h.
#include <greedy_solver.h>
Public Member Functions  
void  Condition () 
void  Init () 
virtual  ~GreedySolver () 
GreedySolver ()  
GreedySolver (bool exclusive_orders)  
GreedySolver (GreedyPreconditioner *c)  
GreedySolver (bool exclusive_orders, GreedyPreconditioner *c)  
double  Capacity (const Arc &a, double u_curr_qty, double v_curr_qty) 
double  Capacity (const Arc &a) 
double  Capacity (ExchangeNode::Ptr n, const Arc &a, bool min_cap, double curr_qty) 
double  Capacity (ExchangeNode::Ptr n, const Arc &a, bool min_cap) 
double  Capacity (ExchangeNode::Ptr n, const Arc &a, double curr_qty) 
double  Capacity (ExchangeNode::Ptr n, const Arc &a) 
Public Member Functions inherited from cyclus::ExchangeSolver  
double  ArcCost (const Arc &a) 
ExchangeSolver (bool exclusive_orders=kDefaultExclusive)  
void  graph (ExchangeGraph *graph) 
ExchangeGraph *  graph () const 
double  Solve (ExchangeGraph *graph=NULL) 
void  verbose () 
virtual  ~ExchangeSolver () 
void  sim_ctx (Context *c) 
Context *  sim_ctx () 
double  PseudoCost () 
double  PseudoCost (double cost_factor) 
double  PseudoCostByCap (double cost_factor) 
double  PseudoCostByPref (double cost_factor) 
Protected Member Functions  
virtual double  SolveGraph () 
Additional Inherited Members  
Static Public Member Functions inherited from cyclus::ExchangeSolver  
static double  Cost (const Arc &a, bool exclusive_orders=kDefaultExclusive) 
Static Public Attributes inherited from cyclus::ExchangeSolver  
static const bool  kDefaultExclusive = true 
Protected Attributes inherited from cyclus::ExchangeSolver  
bool  exclusive_orders_ 
ExchangeGraph *  graph_ 
Context *  sim_ctx_ 
bool  verbose_ 
cyclus::GreedySolver::GreedySolver  (  ) 
GreedySolver constructor.
exclusive_orders  a flag for enforcing integral, quantized orders 
c  a conditioner to use before solving a graph instance 
Definition at line 32 of file greedy_solver.cc.

explicit 
Definition at line 23 of file greedy_solver.cc.

explicit 
Definition at line 28 of file greedy_solver.cc.
cyclus::GreedySolver::GreedySolver  (  bool  exclusive_orders, 
GreedyPreconditioner *  c  
) 
Definition at line 19 of file greedy_solver.cc.

virtual 
Definition at line 36 of file greedy_solver.cc.
double cyclus::GreedySolver::Capacity  (  const Arc &  a, 
double  u_curr_qty,  
double  v_curr_qty  
) 
the capacity of the arc
StateError  if either ExchangeNode does not have a ExchangeNodeGroup 
a  the arc 
u_curr_qty  the current quantity assigned to the unode (if solving piecemeal) 
v_curr_qty  the current quantity assigned to the vnode (if solving piecemeal) 
Definition at line 79 of file greedy_solver.cc.

inline 
Definition at line 101 of file greedy_solver.h.
double cyclus::GreedySolver::Capacity  (  ExchangeNode::Ptr  n, 
const Arc &  a,  
bool  min_cap,  
double  curr_qty  
) 
the capacity of a node
StateError  if ExchangeNode does not have a ExchangeNodeGroup 
n  the node 
min_cap  whether to use the minimum or maximum capacity value. In general, nodes that represent bids use the minimum (i.e., the capacities represents a lessthan constraint) and nodes that represent requests use the maximum value (i.e., the capacities represents a greaterthan constraint). 
curr_qty  the currently allocated node quantity (if solving piecemeal) 
Definition at line 93 of file greedy_solver.cc.

inline 
Definition at line 118 of file greedy_solver.h.

inline 
Definition at line 121 of file greedy_solver.h.

inline 
Definition at line 124 of file greedy_solver.h.
void cyclus::GreedySolver::Condition  (  ) 
Uses the provided (or a default) GreedyPreconditioner to condition the solver's ExchangeGraph so that RequestGroups are ordered by average preference and commodity weight.
Definition at line 41 of file greedy_solver.cc.
void cyclus::GreedySolver::Init  (  ) 
Initialize member values based on the given graph.
Definition at line 46 of file greedy_solver.cc.

protectedvirtual 
the GreedySolver solves an ExchangeGraph by iterating over each RequestGroup and matching requests with the minimum bids possible, starting from the beginning of the the respective request and bid containers.
Implements cyclus::ExchangeSolver.
Definition at line 60 of file greedy_solver.cc.