4 #include <boost/math/special_functions/next.hpp> 42 :
qty(
std::numeric_limits<double>::max()),
58 Arc::Arc(boost::shared_ptr<ExchangeNode> unode,
59 boost::shared_ptr<ExchangeNode> vnode)
62 exclusive_ = unode->exclusive || vnode->exclusive;
64 double fqty = unode->qty;
65 double sqty = vnode->qty;
68 double dist = boost::math::float_distance(fqty, sqty);
69 if (unode->exclusive && vnode->exclusive) {
71 }
else if (unode->exclusive) {
83 : unode_(other.
unode()),
84 vnode_(other.
vnode()),
92 nodes_.push_back(node);
97 std::vector<ExchangeNode::Ptr> nodes;
98 nodes.push_back(node);
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));
void AddRequestGroup(RequestGroup::Ptr prs)
adds a request group to the graph
An arc represents a possible connection between two nodes in the bipartite resource exchange graph...
bool exclusive
whether this node represents an exclusive request or offer
boost::shared_ptr< RequestGroup > Ptr
ExchangeNodeGroup * group
the parent ExchangeNodeGroup to which this ExchangeNode belongs
boost::shared_ptr< ExchangeNode > unode() const
boost::shared_ptr< ExchangeNode > Ptr
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...
std::string commod
the commodity associated with this exchange node
boost::shared_ptr< ExchangeNode > vnode() const
void AddArc(const Arc &a)
adds an arc to the graph
static const double float_ulp_eq
distance in ULP within which floating point numbers should be considered equal.
RequestGroup(double qty=0.0)
void AddExclNode(ExchangeNode::Ptr n)
adds a single node to the set of exclusive node groupings, in general this function is used for deman...
int agent_id
the id of the agent associated with this node
ExchangeNodes are used in ExchangeGraphs to house information about a given translated Bid or Request...
Arc()
default required for usage in maps
void AddMatch(const Arc &a, double qty)
adds a match for a quanity of flow along an arc
virtual void AddExchangeNode(ExchangeNode::Ptr node)
Add the node to the ExchangeNodeGroup and informs the node it is a member of this ExchangeNodeGroup...
void AddSupplyGroup(ExchangeNodeGroup::Ptr prs)
adds a supply group to the graph
bool operator==(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint equality operator.
Code providing rudimentary logging capability for the Cyclus core.
std::map< Arc, std::vector< double > > unit_capacities
unit values associated with this ExchangeNode corresponding to capacties of its parent ExchangeNodeGr...
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
double qty
the maximum amount of a resource that can be associated with this node