4#include <boost/math/special_functions/next.hpp>
50 return (
lhs.unit_capacities ==
rhs.unit_capacities &&
52 lhs.exclusive ==
rhs.exclusive &&
59 boost::shared_ptr<ExchangeNode> vnode)
62 exclusive_ =
unode->exclusive ||
vnode->exclusive;
68 double dist = boost::math::float_distance(
fqty,
sqty);
71 }
else if (
unode->exclusive) {
83 : unode_(
other.unode()),
84 vnode_(
other.vnode()),
86 exclusive_(
other.exclusive()),
87 excl_val_(
other.excl_val()) {}
92 nodes_.push_back(
node);
97 std::vector<ExchangeNode::Ptr>
nodes;
99 excl_node_groups_.push_back(
nodes);
108 if (
node->exclusive) {
118 request_groups_.push_back(
prs);
123 supply_groups_.push_back(
pss);
129 int id = next_arc_id_++;
130 arc_ids_.insert(std::pair<Arc, int>(
a,
id));
131 arc_by_id_.insert(std::pair<int, Arc>(
id,
a));
132 node_arc_map_[
a.unode()].push_back(
a);
133 node_arc_map_[
a.vnode()].push_back(
a);
138 matches_.push_back(std::make_pair(
a, qty));
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
Arc()
default required for usage in maps
void AddRequestGroup(RequestGroup::Ptr prs)
adds a request group to the graph
void AddSupplyGroup(ExchangeNodeGroup::Ptr prs)
adds a supply group to the graph
void AddMatch(const Arc &a, double qty)
adds a match for a quanity of flow along an arc
void AddArc(const Arc &a)
adds an arc to the graph
boost::shared_ptr< ExchangeNodeGroup > Ptr
virtual void AddExchangeNode(ExchangeNode::Ptr node)
Add the node to the ExchangeNodeGroup and informs the node it is a member of this ExchangeNodeGroup.
const std::vector< ExchangeNode::Ptr > & nodes() const
void AddExclNode(ExchangeNode::Ptr n)
adds a single node to the set of exclusive node groupings, in general this function is used for deman...
virtual void AddExchangeNode(ExchangeNode::Ptr node)
Add the node to the ExchangeNodeGroup and informs the node it is a member of this ExchangeNodeGroup,...
RequestGroup(double qty=0.0)
boost::shared_ptr< RequestGroup > Ptr
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
static const double float_ulp_eq
distance in ULP within which floating point numbers should be considered equal.
bool operator==(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint equality operator.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
ExchangeNodes are used in ExchangeGraphs to house information about a given translated Bid or Request...
boost::shared_ptr< ExchangeNode > Ptr