1#ifndef CYCLUS_SRC_GREEDY_SOLVER_H_ 
    2#define CYCLUS_SRC_GREEDY_SOLVER_H_ 
    4#include <boost/shared_ptr.hpp> 
   14void Capacity(cyclus::Arc 
const&, 
double, 
double);
 
   15void Capacity(boost::shared_ptr<cyclus::ExchangeNode>, cyclus::Arc 
const&,
 
   28  int lu = l.
unode()->agent_id;
 
   29  int lv = l.
vnode()->agent_id;
 
   30  int ru = r.
unode()->agent_id;
 
   31  int rv = r.
vnode()->agent_id;
 
   32  double lpref = l.
unode()->prefs[l];
 
   33  double rpref = r.
unode()->prefs[r];
 
   34  return (lpref != rpref) ? (lpref > rpref)
 
   35                          : (lu > ru || (lu == ru && lv > rv));
 
 
   42  int lid = l->agent_id;
 
   43  int rid = r->agent_id;
 
   46  return (lpref != rpref) ? (lpref > rpref) : (lid > rid);
 
 
   50class GreedyPreconditioner;
 
  103  double Capacity(
const Arc& a, 
double u_curr_qty, 
double v_curr_qty);
 
  124    return Capacity(n, a, min_cap, 0.0);
 
 
  127    return Capacity(n, a, 
true, curr_qty);
 
 
  153  void UpdateObj(
double qty, 
double pref);
 
  156  std::map<ExchangeNode::Ptr, double> n_qty_;
 
  157  std::map<ExchangeNodeGroup*, std::vector<double>> grp_caps_;
 
 
An arc represents a possible connection between two nodes in the bipartite resource exchange graph.
 
boost::shared_ptr< ExchangeNode > vnode() const
 
boost::shared_ptr< ExchangeNode > unode() const
 
boost::shared_ptr< ExchangeNodeGroup > Ptr
 
ExchangeSolver(bool exclusive_orders=kDefaultExclusive)
 
A GreedyPreconditioner conditions an ExchangeGraph for a GreedySolver by ordering the RequestGroups a...
 
virtual double SolveGraph()
the GreedySolver solves an ExchangeGraph by iterating over each RequestGroup and matching requests wi...
 
double Capacity(ExchangeNode::Ptr n, const Arc &a, double curr_qty)
 
GreedySolver()
GreedySolver constructor.
 
double Capacity(ExchangeNode::Ptr n, const Arc &a, bool min_cap)
 
double Capacity(const Arc &a, double u_curr_qty, double v_curr_qty)
the capacity of the arc
 
double Capacity(const Arc &a)
 
void Condition()
Uses the provided (or a default) GreedyPreconditioner to condition the solver's ExchangeGraph so that...
 
double Capacity(ExchangeNode::Ptr n, const Arc &a)
 
void Init()
Initialize member values based on the given graph.
 
boost::shared_ptr< RequestGroup > Ptr
 
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
 
double AvgPref(ExchangeNode::Ptr n)
 
void Capacity(cyclus::Arc const &, double, double)
 
bool AvgPrefComp(ExchangeNode::Ptr l, ExchangeNode::Ptr r)
A comparison function for sorting a container of Nodes by the nodes preference in decensing order (i....
 
bool ReqPrefComp(const Arc &l, const Arc &r)
double Capacity(const Arc& a, double u_curr_qty, double v_curr_qty) { return 0; }
 
boost::shared_ptr< ExchangeNode > Ptr