1 #ifndef CYCLUS_SRC_GREEDY_PRECONDITIONER_H_ 2 #define CYCLUS_SRC_GREEDY_PRECONDITIONER_H_ 13 std::map<std::string, double>* weights,
18 std::map<std::string, double>* weights,
19 std::map<ExchangeNode::Ptr, double>* avg_prefs);
90 NodeWeight(l, &commod_weights_, avg_prefs_[l]) >
91 NodeWeight(r, &commod_weights_, avg_prefs_[r]);
98 return group_weights_[l] > group_weights_[r];
104 void ProcessWeights_(
WgtOrder order);
106 bool apply_commod_weights_;
107 std::map<ExchangeNode::Ptr, double> avg_prefs_;
108 std::map<std::string, double> commod_weights_;
109 std::map<RequestGroup::Ptr, double> group_weights_;
114 #endif // CYCLUS_SRC_GREEDY_PRECONDITIONER_H_ GreedyPreconditioner()
constructor if weights are given in heaviest-first order
bool NodeComp(const ExchangeNode::Ptr l, const ExchangeNode::Ptr r)
a comparitor for ordering containers of ExchangeNode::Ptrs in descending order based on their commodi...
boost::shared_ptr< RequestGroup > Ptr
boost::shared_ptr< ExchangeNode > Ptr
double GroupWeight(RequestGroup::Ptr g, std::map< std::string, double > *weights, std::map< ExchangeNode::Ptr, double > *avg_prefs)
A GreedyPreconditioner conditions an ExchangeGraph for a GreedySolver by ordering the RequestGroups a...
a flag for commodity weights given in the reverse order,
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
double AvgPref(ExchangeNode::Ptr n)
bool GroupComp(const RequestGroup::Ptr l, const RequestGroup::Ptr r)
a comparitor for ordering containers of Request::Ptrs in descending order based on their average comm...
double NodeWeight(ExchangeNode::Ptr n, std::map< std::string, double > *weights, double avg_pref)
An ExchangeGraph is a resource-neutral representation of a ResourceExchange.
void Condition(ExchangeGraph *graph)
conditions the graph as described above
WgtOrder
the order of commodity weights