Small corrections
diff --git a/helper/ndn-global-routing-helper.cc b/helper/ndn-global-routing-helper.cc
index 68f7228..f87dfa8 100644
--- a/helper/ndn-global-routing-helper.cc
+++ b/helper/ndn-global-routing-helper.cc
@@ -258,7 +258,7 @@
fib->InvalidateAll ();
NS_ASSERT (fib != 0);
- cout << "Reachability from Node: " << source->GetObject<Node> ()->GetId () << endl;
+ NS_LOG_DEBUG ("Reachability from Node: " << source->GetObject<Node> ()->GetId ());
for (DistancesMap::iterator i = distances.begin ();
i != distances.end ();
i++)
@@ -276,9 +276,9 @@
{
BOOST_FOREACH (const Ptr<const NameComponents> &prefix, i->first->GetLocalPrefixes ())
{
- cout << " prefix " << prefix << " reachable via face " << *i->second.get<0> ()
- << " with distance " << i->second.get<1> ()
- << " with delay " << i->second.get<2> () << endl;
+ NS_LOG_DEBUG (" prefix " << prefix << " reachable via face " << *i->second.get<0> ()
+ << " with distance " << i->second.get<1> ()
+ << " with delay " << i->second.get<2> ());
Ptr<fib::Entry> entry = fib->Add (prefix, i->second.get<0> (), i->second.get<1> ());
Ptr<Limits> limits = i->second.get<0> ()->GetObject<Limits> ();
diff --git a/plugins/topology/annotated-topology-reader.cc b/plugins/topology/annotated-topology-reader.cc
index d62c6b5..ecb4512 100644
--- a/plugins/topology/annotated-topology-reader.cc
+++ b/plugins/topology/annotated-topology-reader.cc
@@ -93,7 +93,15 @@
Ptr<Node>
AnnotatedTopologyReader::CreateNode (const std::string name, uint32_t systemId)
{
- return CreateNode (name, m_randX.GetValue (), m_randY.GetValue (), systemId);
+ NS_LOG_FUNCTION (this << name);
+ m_requiredPartitions = std::max (m_requiredPartitions, systemId + 1);
+
+ Ptr<Node> node = CreateObject<Node> (systemId);
+
+ Names::Add (m_path, name, node);
+ m_nodes.Add (node);
+
+ return node;
}
Ptr<Node>
@@ -161,13 +169,18 @@
istringstream lineBuffer (line);
string name, city;
- double latitude, longitude;
+ double latitude = 0, longitude = 0;
uint32_t systemId = 0;
lineBuffer >> name >> city >> latitude >> longitude >> systemId;
if (name.empty ()) continue;
- Ptr<Node> node = CreateNode (name, m_scale*longitude, -m_scale*latitude, systemId);
+ Ptr<Node> node;
+
+ if (abs(latitude) > 0.001 && abs(latitude) > 0.001)
+ node = CreateNode (name, m_scale*longitude, -m_scale*latitude, systemId);
+ else
+ node = CreateNode (name, systemId);
}
map<string, set<string> > processedLinks; // to eliminate duplications
@@ -201,9 +214,9 @@
processedLinks[from].insert (to);
Ptr<Node> fromNode = Names::Find<Node> (m_path, from);
- NS_ASSERT (fromNode != 0);
+ NS_ASSERT_MSG (fromNode != 0, from << " node not found");
Ptr<Node> toNode = Names::Find<Node> (m_path, to);
- NS_ASSERT (fromNode != 0);
+ NS_ASSERT_MSG (toNode != 0, to << " node not found");
Link link (fromNode, from, toNode, to);
@@ -214,7 +227,7 @@
link.SetAttribute ("Delay", delay);
if (!maxPackets.empty ())
link.SetAttribute ("MaxPackets", maxPackets);
-
+
AddLink (link);
NS_LOG_DEBUG ("New link " << from << " <==> " << to << " / " << capacity << " with " << metric << " metric (" << delay << ", " << maxPackets << ")");
}
@@ -309,6 +322,7 @@
BOOST_FOREACH (Link &link, m_linksList)
{
+ // cout << "Link: " << Findlink.GetFromNode () << ", " << link.GetToNode () << endl;
string tmp;
if (link.GetAttributeFailSafe ("DataRate", tmp))