--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/BriteNode.cc Tue Feb 22 14:35:19 2011 -0500
@@ -0,0 +1,77 @@
+/****************************************************************************/
+/* Copyright 2001, Trustees of Boston University. */
+/* All Rights Reserved. */
+/* */
+/* Permission to use, copy, or modify this software and its documentation */
+/* for educational and research purposes only and without fee is hereby */
+/* granted, provided that this copyright notice appear on all copies and */
+/* supporting documentation. For any other uses of this software, in */
+/* original or modified form, including but not limited to distribution in */
+/* whole or in part, specific prior permission must be obtained from Boston */
+/* University. These programs shall not be used, rewritten, or adapted as */
+/* the basis of a commercial software or hardware product without first */
+/* obtaining appropriate licenses from Boston University. Boston University*/
+/* and the author(s) make no representations about the suitability of this */
+/* software for any purpose. It is provided "as is" without express or */
+/* implied warranty. */
+/* */
+/****************************************************************************/
+/* */
+/* Author: Alberto Medina */
+/* Anukool Lakhina */
+/* Title: BRITE: Boston university Representative Topology gEnerator */
+/* Revision: 2.0 4/02/2001 */
+/****************************************************************************/
+#pragma implementation "BriteNode.h"
+
+#include "BriteNode.h"
+
+namespace brite {
+
+BriteNode::BriteNode(int i) {
+
+ nodeId = i;
+ nodeAddr = 0;
+ inDegree = 0;
+ outDegree = 0;
+ nodeColor = BLACK;
+
+}
+
+BriteNode::BriteNode(NodeConf* c) {
+
+ nodeInfo = c;
+
+}
+
+ASNodeConf::ASNodeConf() {
+
+ SetCost(1.0);
+ t = NULL;
+ SetNodeType(AS_NODE);
+ astype = AS_NONE;
+
+}
+
+RouterNodeConf::RouterNodeConf() {
+
+ SetCost(1.0);
+ SetNodeType(RT_NODE);
+ rttype = RT_NONE;
+
+}
+
+
+void ASNodeConf::SetTopology(Topology* top, int asid) {
+
+ t = top;
+ if (t != NULL) {
+ Graph* g = t->GetGraph();
+ for (int i = 0; i < g->GetNumNodes(); i++) {
+ RouterNodeConf* rt_conf = (RouterNodeConf*)(g->GetNodePtr(i)->GetNodeInfo());
+ rt_conf->SetASId(asid);
+ }
+ }
+}
+
+} // namespace brite
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/BriteNode.h Tue Feb 22 14:35:19 2011 -0500
@@ -0,0 +1,143 @@
+/****************************************************************************/
+/* Copyright 2001, Trustees of Boston University. */
+/* All Rights Reserved. */
+/* */
+/* Permission to use, copy, or modify this software and its documentation */
+/* for educational and research purposes only and without fee is hereby */
+/* granted, provided that this copyright notice appear on all copies and */
+/* supporting documentation. For any other uses of this software, in */
+/* original or modified form, including but not limited to distribution in */
+/* whole or in part, specific prior permission must be obtained from Boston */
+/* University. These programs shall not be used, rewritten, or adapted as */
+/* the basis of a commercial software or hardware product without first */
+/* obtaining appropriate licenses from Boston University. Boston University*/
+/* and the author(s) make no representations about the suitability of this */
+/* software for any purpose. It is provided "as is" without express or */
+/* implied warranty. */
+/* */
+/****************************************************************************/
+/* */
+/* Author: Alberto Medina */
+/* Anukool Lakhina */
+/* Title: BRITE: Boston university Representative Topology gEnerator */
+/* Revision: 2.0 4/02/2001 */
+/****************************************************************************/
+#ifndef BRITENODE_H
+#define BRITENODE_H
+#pragma interface
+
+#include "Util.h"
+#include "Graph.h"
+#include "Topology.h"
+
+namespace brite {
+
+class Topology;
+class NodeConf;
+class Graph;
+
+class BriteNode {
+
+ public:
+
+ BriteNode(int i);
+ BriteNode(NodeConf* info);
+
+ int GetId() { return nodeId; }
+ int GetAddr() { return nodeAddr; }
+ int GetInDegree() { return inDegree; }
+ int GetOutDegree() { return outDegree; }
+ Color GetColor() { return nodeColor; }
+ NodeConf* GetNodeInfo() { return nodeInfo; }
+
+ void SetId(int id) { nodeId = id; }
+ void SetAddr(int addr) { nodeAddr = addr; }
+ void SetInDegree(int degree) { inDegree = degree; }
+ void SetOutDegree(int degree) { outDegree = degree; }
+ void SetColor(Color col) { nodeColor = col; }
+ void SetNodeInfo(NodeConf* info) { nodeInfo = info; }
+
+ private:
+
+ int nodeId;
+ int nodeAddr;
+ int inDegree;
+ int outDegree;
+ Color nodeColor;
+ NodeConf* nodeInfo;
+
+};
+
+// to derive from it specific node types
+class NodeConf {
+
+ public:
+
+ enum NodeType { AS_NODE = 1, RT_NODE = 2 };
+ double GetCost() { return cost; }
+ void SetCost(double c) { cost = c; }
+ NodeType GetNodeType() { return type; }
+ void SetNodeType(NodeType t) { type = t; }
+ double GetCoordX() { return x; }
+ double GetCoordY() { return y; }
+ double GetCoordZ() { return z; }
+ void SetCoord(double xval, double yval, double zval) {
+ x = xval;
+ y = yval;
+ z = zval;
+ }
+
+ private:
+
+ double cost;
+ NodeType type;
+ double x;
+ double y;
+ double z;
+
+};
+
+
+class RouterNodeConf : public NodeConf {
+
+ public:
+
+ RouterNodeConf();
+ enum RouterNodeType { RT_NONE, RT_LEAF, RT_BORDER, RT_STUB, RT_BACKBONE };
+ RouterNodeType GetRouterType() { return rttype; }
+ void SetRouterType(RouterNodeType t) { rttype = t; }
+ int GetASId() { return ASid; }
+ void SetASId(int i) { ASid = i; }
+
+ private:
+
+ RouterNodeType rttype;
+ int ASid;
+
+};
+
+class ASNodeConf : public NodeConf {
+
+ public:
+
+ enum ASNodeType {AS_NONE, AS_LEAF, AS_STUB, AS_BORDER, AS_BACKBONE};
+ ASNodeConf();
+ ~ASNodeConf();
+ Topology* GetTopology() { return t; }
+ void SetTopology(Topology* top, int asid);
+ ASNodeType GetASType() { return astype; }
+ void SetASType(ASNodeType t) { astype = t; }
+ int GetASId() { return ASid; }
+ void SetASId(int i) { ASid = i; }
+
+ private:
+
+ Topology* t;
+ ASNodeType astype;
+ int ASid;
+
+};
+
+} // namespace brite
+
+#endif /* BRITENODE_H */
--- a/Edge.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Edge.cc Tue Feb 22 14:35:19 2011 -0500
@@ -30,7 +30,7 @@
int Edge::edge_count = 0;
-Edge::Edge(Node* s, Node* d)
+Edge::Edge(BriteNode* s, BriteNode* d)
{
assert(s != NULL && d != NULL);
--- a/Edge.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Edge.h Tue Feb 22 14:35:19 2011 -0500
@@ -27,13 +27,13 @@
#pragma interface
#include "Util.h"
-#include "Node.h"
+#include "BriteNode.h"
namespace brite {
#define SPEED_OF_LIGHT 299792458.0
-class Node;
+class BriteNode;
class EdgeConf;
enum EdgeType { E_NONE, E_STUB, E_BACKBONE };
@@ -42,7 +42,7 @@
public:
- Edge(Node* s, Node* d);
+ Edge(BriteNode* s, BriteNode* d);
~Edge();
EdgeConf* GetConf() { return conf; }
@@ -52,8 +52,8 @@
void SetConf(EdgeConf* c) { conf = c; }
Color GetColor() { return color; }
void SetColor(Color c) { color = c; }
- Node* GetSrc() { return src; }
- Node* GetDst() { return dst; }
+ BriteNode* GetSrc() { return src; }
+ BriteNode* GetDst() { return dst; }
double Length();
void SetDirection(bool s) { directed = s;}
bool GetDirection() { return directed;}
@@ -61,8 +61,8 @@
private:
int id;
- Node* src;
- Node* dst;
+ BriteNode* src;
+ BriteNode* dst;
Color color;
EdgeConf* conf;
static int edge_count;
--- a/Graph.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Graph.cc Tue Feb 22 14:35:19 2011 -0500
@@ -38,7 +38,7 @@
}
-void Graph::AddNode(Node* node, int index)
+void Graph::AddNode(BriteNode* node, int index)
{
assert(index >= 0 && index < numNodes);
@@ -82,7 +82,7 @@
}
-Node* Graph::GetNodePtr(int index) {
+BriteNode* Graph::GetNodePtr(int index) {
assert(index >= 0 && index < numNodes);
return nodes[index];
--- a/Graph.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Graph.h Tue Feb 22 14:35:19 2011 -0500
@@ -26,12 +26,12 @@
#define GRAPH_H
#pragma interface
-#include "Node.h"
+#include "BriteNode.h"
#include "Edge.h"
namespace brite {
-class Node;
+class BriteNode;
class Edge;
class Graph {
@@ -48,11 +48,11 @@
Graph(int size);
- void AddNode(Node* node, int i);
+ void AddNode(BriteNode* node, int i);
void AddEdge(Edge* edge);
void AddAdjListNode(int n1, int n2);
void AddIncListNode(Edge* edge);
- Node* GetNodePtr(int index);
+ BriteNode* GetNodePtr(int index);
int GetAdjListSize(int u) { return adjList[u].size(); }
int GetIncListSize(int u) { return incList[u].size(); }
int GetEdgeListSize() { return edges.size(); }
@@ -66,7 +66,7 @@
int numNodes;
int numEdges;
- std::vector<Node*> nodes;
+ std::vector<BriteNode*> nodes;
std::list<Edge*> edges;
std::vector< std::list<int> > adjList;
std::vector< std::list<Edge*> > incList;
--- a/Makefile Tue Feb 22 13:17:57 2011 -0500
+++ b/Makefile Tue Feb 22 14:35:19 2011 -0500
@@ -4,11 +4,11 @@
CFLAGS = -shared -Wl,-soname,libbrite.so -o libbrite.so
MODELS=./Models
-brite: BriteMain.o Node.o Edge.o Graph.o Topology.o Util.o Parser.o \
+brite: BriteMain.o BriteNode.o Edge.o Graph.o Topology.o Util.o Parser.o \
Parser.o Model.o RouterModel.o ASModel.o RouterWaxmanModel.o \
RouterBarabasiAlbertModel.o ASWaxmanModel.o ASBarabasiAlbertModel.o \
TopDownHierModel.o BottomUpHierModel.o ImportedFileModel.o
- $(CC) $(CFLAGS) BriteMain.o Graph.o Topology.o Node.o \
+ $(CC) $(CFLAGS) BriteMain.o Graph.o Topology.o BriteNode.o \
Edge.o Util.o Parser.o Model.o RouterModel.o \
ASModel.o RouterWaxmanModel.o RouterBarabasiAlbertModel.o \
ASWaxmanModel.o ASBarabasiAlbertModel.o \
@@ -17,8 +17,8 @@
BriteMain.o: BriteMain.cc Brite.h
$(CC) -fPIC -c BriteMain.cc -g
-Node.o: Node.cc Node.h
- $(CC) -fPIC -c Node.cc -g
+BriteNode.o: BriteNode.cc BriteNode.h
+ $(CC) -fPIC -c BriteNode.cc -g
Edge.o: Edge.cc Edge.h
$(CC) -fPIC -c Edge.cc -g
--- a/Models/ASBarabasiAlbertModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/ASBarabasiAlbertModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -106,7 +106,7 @@
}
-inline double ASBarabasiAlbert::ProbFunc(Node* dst) {
+inline double ASBarabasiAlbert::ProbFunc(BriteNode* dst) {
/* return interconnection probability */
assert(SumDj > 0);
@@ -118,7 +118,7 @@
void ASBarabasiAlbert::InterconnectNodes(Graph *g) {
int edges_added;
- Node *src, *dst;
+ BriteNode *src, *dst;
double p;
RandomVariable U(s_connect);
--- a/Models/ASBarabasiAlbertModel.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/ASBarabasiAlbertModel.h Tue Feb 22 14:35:19 2011 -0500
@@ -37,7 +37,7 @@
public:
ASBarabasiAlbert(ASBarabasiAlbertPar* par);
- double ProbFunc(Node* dst);
+ double ProbFunc(BriteNode* dst);
Graph* Generate();
std::string ToString();
--- a/Models/ASModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/ASModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -72,7 +72,7 @@
double x, y, z;
int num_squares, num_placed, num;
- Node* node;
+ BriteNode* node;
RandomVariable U(s_places);
int n = size;
@@ -102,7 +102,7 @@
try {
/* Create Node and Node configuration */
- node = new Node(i);
+ node = new BriteNode(i);
g->AddNode(node, i);
/* Set information specific to AS nodes */
@@ -160,7 +160,7 @@
try {
/* Create Node and Node configuration */
- node = new Node(num_placed);
+ node = new BriteNode(num_placed);
g->AddNode(node, num_placed);
/* Set information specific to router nodes */
--- a/Models/ASWaxmanModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/ASWaxmanModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -78,7 +78,7 @@
}
-double ASWaxman::ProbFunc(Node* src, Node* dst) {
+double ASWaxman::ProbFunc(BriteNode* src, BriteNode* dst) {
double d, L;
double x1, y1, x2, y2, dx, dy;
@@ -136,7 +136,7 @@
void ASWaxman::InterconnectNodes(Graph* g) {
int num_connected, n1, n2, edges_added;
- Node *src, *dst;
+ BriteNode *src, *dst;
double p;
RandomVariable U(s_connect);
--- a/Models/ASWaxmanModel.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/ASWaxmanModel.h Tue Feb 22 14:35:19 2011 -0500
@@ -52,7 +52,7 @@
protected:
void InterconnectNodes(Graph* graph);
- double ProbFunc(Node* src, Node* dst);
+ double ProbFunc(BriteNode* src, BriteNode* dst);
private:
double alpha;
--- a/Models/BottomUpHierModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/BottomUpHierModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -161,7 +161,7 @@
int i, j, size, n, assigned;
int start, count, total_assigned = 0;
- Node* Src;
+ BriteNode* Src;
RandomVariable G(Model::s_grouping);
RandomVariable A(Model::s_assignment);
--- a/Models/ImportedFileModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/ImportedFileModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -272,7 +272,7 @@
try {
/* Add node to Graph */
- Node* node = new Node(j);
+ BriteNode* node = new BriteNode(j);
graph->AddNode(node, j);
node->SetId(nid);
node->SetInDegree(ideg);
@@ -482,7 +482,7 @@
try {
/* Add node to Graph */
- Node* node = new Node(j);
+ BriteNode* node = new BriteNode(j);
graph->AddNode(node, j);
assert(j == nid);
node->SetInDegree(0);
@@ -541,8 +541,8 @@
try {
/* Add new edge to graph */
- Node* Src = graph->GetNodePtr(nfrom);
- Node* Dst = graph->GetNodePtr(nto);
+ BriteNode* Src = graph->GetNodePtr(nfrom);
+ BriteNode* Dst = graph->GetNodePtr(nto);
Edge* edge = new Edge(Src, Dst );
graph->AddEdge(edge);
@@ -683,7 +683,7 @@
try {
/* Add node to Graph */
- Node* node = new Node(j);
+ BriteNode* node = new BriteNode(j);
graph->AddNode(node, j);
assert(j == nid);
node->SetInDegree(0);
@@ -739,8 +739,8 @@
try {
/* Add new edge to graph */
- Node* Src = graph->GetNodePtr(nfrom);
- Node* Dst = graph->GetNodePtr(nto);
+ BriteNode* Src = graph->GetNodePtr(nfrom);
+ BriteNode* Dst = graph->GetNodePtr(nto);
Edge* edge = new Edge(Src, Dst );
graph->AddEdge(edge);
@@ -895,7 +895,7 @@
}
/* Add node to Graph */
- Node* node = new Node(nid);
+ BriteNode* node = new BriteNode(nid);
g->AddNode(node, nid);
RouterNodeConf* n_rt_conf;
@@ -941,8 +941,8 @@
try {
/* Add new edge to graph */
- Node* Src = g->GetNodePtr(nidfrom);
- Node* Dst = g->GetNodePtr(nidto);
+ BriteNode* Src = g->GetNodePtr(nidfrom);
+ BriteNode* Dst = g->GetNodePtr(nidto);
Edge* edge = new Edge( Src, Dst );
g->AddEdge(edge);
Src->SetOutDegree(Src->GetOutDegree() + 1);
@@ -1024,7 +1024,7 @@
try {
/* Add node to Graph */
- Node* node = new Node(j);
+ BriteNode* node = new BriteNode(j);
graph->AddNode(node, j);
node->SetId(nid);
@@ -1074,8 +1074,8 @@
int nto = atoi(toks[1].c_str());
double len = atof(toks[2].c_str());
- Node* Src = graph->GetNodePtr(nfrom);
- Node* Dst = graph->GetNodePtr(nto);
+ BriteNode* Src = graph->GetNodePtr(nfrom);
+ BriteNode* Dst = graph->GetNodePtr(nto);
try {
--- a/Models/Model.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/Model.h Tue Feb 22 14:35:19 2011 -0500
@@ -47,7 +47,7 @@
enum AssignmentType { A_CONST = 1, A_UNIF = 2, A_EXP = 3, A_HT = 4 };
class Graph;
-class Node;
+class BriteNode;
//////////////////////////////////////////////
//
--- a/Models/RouterBarabasiAlbertModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/RouterBarabasiAlbertModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -75,7 +75,7 @@
-double RouterBarabasiAlbert::ProbFunc(Node* dst) {
+double RouterBarabasiAlbert::ProbFunc(BriteNode* dst) {
/* return interconnection probability */
assert(SumDj > 0);
@@ -122,7 +122,7 @@
void RouterBarabasiAlbert::InterconnectNodes(Graph *g) {
int edges_added;
- Node *src, *dst;
+ BriteNode *src, *dst;
double p;
RandomVariable U(s_connect);
--- a/Models/RouterBarabasiAlbertModel.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/RouterBarabasiAlbertModel.h Tue Feb 22 14:35:19 2011 -0500
@@ -47,7 +47,7 @@
public:
RouterBarabasiAlbert(RouterBarabasiAlbertPar* par);
- double ProbFunc(Node* dst);
+ double ProbFunc(BriteNode* dst);
Graph* Generate();
std::string ToString();
--- a/Models/RouterModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/RouterModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -72,7 +72,7 @@
double x, y, z;
int num_squares, num_placed, num;
- Node* node;
+ BriteNode* node;
RouterNodeConf* rt_conf;
RandomVariable U(s_places);
@@ -102,7 +102,7 @@
try {
/* Add node to Graph */
- node = new Node(i);
+ node = new BriteNode(i);
g->AddNode(node, i);
/* Set information specific to router nodes */
@@ -159,7 +159,7 @@
/* Create Node and Node configuration */
try {
- node = new Node(num_placed);
+ node = new BriteNode(num_placed);
g->AddNode(node, num_placed);
/* Set information specific to router nodes */
--- a/Models/RouterWaxmanModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/RouterWaxmanModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -79,7 +79,7 @@
}
-double RouterWaxman::ProbFunc(Node* src, Node* dst) {
+double RouterWaxman::ProbFunc(BriteNode* src, BriteNode* dst) {
double d, L;
double x1, y1, x2, y2, dx, dy;
@@ -135,7 +135,7 @@
void RouterWaxman::InterconnectNodes(Graph *g) {
int num_connected, n1, n2, edges_added;
- Node *src, *dst;
+ BriteNode *src, *dst;
double p;
RandomVariable U(s_connect);
RandomVariable BW(s_bandwidth);
--- a/Models/RouterWaxmanModel.h Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/RouterWaxmanModel.h Tue Feb 22 14:35:19 2011 -0500
@@ -55,7 +55,7 @@
private:
- double ProbFunc(Node* src, Node* dst);
+ double ProbFunc(BriteNode* src, BriteNode* dst);
double alpha;
double beta;
--- a/Models/TopDownHierModel.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Models/TopDownHierModel.cc Tue Feb 22 14:35:19 2011 -0500
@@ -282,7 +282,7 @@
for (int j = 0; j < t->GetNumNodes(); j++) {
- Node* node = t->GetGraph()->GetNodePtr(j);
+ BriteNode* node = t->GetGraph()->GetNodePtr(j);
((RouterNodeConf*)(node->GetNodeInfo()))->SetASId(i);
new_graph->AddNode(node, index);
node->SetId(index);
@@ -319,7 +319,7 @@
void TopDownHierModel::InterConnectBorders(Graph* g, Graph* flat_g) {
int ASFrom, ASTo, num_nodes_i, n1, n2;
- Node *Src, *Dst;
+ BriteNode *Src, *Dst;
Edge* edge;
vector<int> positions(g->GetNumNodes());
RandomVariable U(s_edgeconn);
@@ -431,7 +431,7 @@
int n, smallest = MAXINT;
for (int i = p[ASid]; i < up; i++) {
- Node* node = flat_g->GetNodePtr(i);
+ BriteNode* node = flat_g->GetNodePtr(i);
if (node->GetOutDegree() < smallest) {
n = i;
smallest = node->GetOutDegree();
@@ -456,7 +456,7 @@
int min = MAXINT;
for(int i = 0; i < flat_g->GetNumNodes(); i++ ){
- Node* node = flat_g->GetNodePtr(i);
+ BriteNode* node = flat_g->GetNodePtr(i);
if (node->GetOutDegree() < min) {
min = node->GetOutDegree();
}
@@ -464,7 +464,7 @@
int n, smallest = MAXINT;
for (int i = p[ASid]; i < up; i++) {
- Node* node = flat_g->GetNodePtr(i);
+ BriteNode* node = flat_g->GetNodePtr(i);
if ((node->GetOutDegree() < smallest) &&
(node->GetOutDegree() > min)) {
n = i;
@@ -489,7 +489,7 @@
int n, smallest = MAXINT;
for (int i = p[ASid]; i < up; i++) {
- Node* node = flat_g->GetNodePtr(i);
+ BriteNode* node = flat_g->GetNodePtr(i);
if ((node->GetOutDegree() < smallest) &&
(node->GetOutDegree() > k)) {
n = i;
--- a/Node.cc Tue Feb 22 13:17:57 2011 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/****************************************************************************/
-/* Copyright 2001, Trustees of Boston University. */
-/* All Rights Reserved. */
-/* */
-/* Permission to use, copy, or modify this software and its documentation */
-/* for educational and research purposes only and without fee is hereby */
-/* granted, provided that this copyright notice appear on all copies and */
-/* supporting documentation. For any other uses of this software, in */
-/* original or modified form, including but not limited to distribution in */
-/* whole or in part, specific prior permission must be obtained from Boston */
-/* University. These programs shall not be used, rewritten, or adapted as */
-/* the basis of a commercial software or hardware product without first */
-/* obtaining appropriate licenses from Boston University. Boston University*/
-/* and the author(s) make no representations about the suitability of this */
-/* software for any purpose. It is provided "as is" without express or */
-/* implied warranty. */
-/* */
-/****************************************************************************/
-/* */
-/* Author: Alberto Medina */
-/* Anukool Lakhina */
-/* Title: BRITE: Boston university Representative Topology gEnerator */
-/* Revision: 2.0 4/02/2001 */
-/****************************************************************************/
-#pragma implementation "Node.h"
-
-#include "Node.h"
-
-namespace brite {
-
-Node::Node(int i) {
-
- nodeId = i;
- nodeAddr = 0;
- inDegree = 0;
- outDegree = 0;
- nodeColor = BLACK;
-
-}
-
-Node::Node(NodeConf* c) {
-
- nodeInfo = c;
-
-}
-
-ASNodeConf::ASNodeConf() {
-
- SetCost(1.0);
- t = NULL;
- SetNodeType(AS_NODE);
- astype = AS_NONE;
-
-}
-
-RouterNodeConf::RouterNodeConf() {
-
- SetCost(1.0);
- SetNodeType(RT_NODE);
- rttype = RT_NONE;
-
-}
-
-
-void ASNodeConf::SetTopology(Topology* top, int asid) {
-
- t = top;
- if (t != NULL) {
- Graph* g = t->GetGraph();
- for (int i = 0; i < g->GetNumNodes(); i++) {
- RouterNodeConf* rt_conf = (RouterNodeConf*)(g->GetNodePtr(i)->GetNodeInfo());
- rt_conf->SetASId(asid);
- }
- }
-}
-
-} // namespace brite
--- a/Node.h Tue Feb 22 13:17:57 2011 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/****************************************************************************/
-/* Copyright 2001, Trustees of Boston University. */
-/* All Rights Reserved. */
-/* */
-/* Permission to use, copy, or modify this software and its documentation */
-/* for educational and research purposes only and without fee is hereby */
-/* granted, provided that this copyright notice appear on all copies and */
-/* supporting documentation. For any other uses of this software, in */
-/* original or modified form, including but not limited to distribution in */
-/* whole or in part, specific prior permission must be obtained from Boston */
-/* University. These programs shall not be used, rewritten, or adapted as */
-/* the basis of a commercial software or hardware product without first */
-/* obtaining appropriate licenses from Boston University. Boston University*/
-/* and the author(s) make no representations about the suitability of this */
-/* software for any purpose. It is provided "as is" without express or */
-/* implied warranty. */
-/* */
-/****************************************************************************/
-/* */
-/* Author: Alberto Medina */
-/* Anukool Lakhina */
-/* Title: BRITE: Boston university Representative Topology gEnerator */
-/* Revision: 2.0 4/02/2001 */
-/****************************************************************************/
-#ifndef NODE_H
-#define NODE_H
-#pragma interface
-
-#include "Util.h"
-#include "Graph.h"
-#include "Topology.h"
-
-namespace brite {
-
-class Topology;
-class NodeConf;
-class Graph;
-
-class Node {
-
- public:
-
- Node(int i);
- Node(NodeConf* info);
-
- int GetId() { return nodeId; }
- int GetAddr() { return nodeAddr; }
- int GetInDegree() { return inDegree; }
- int GetOutDegree() { return outDegree; }
- Color GetColor() { return nodeColor; }
- NodeConf* GetNodeInfo() { return nodeInfo; }
-
- void SetId(int id) { nodeId = id; }
- void SetAddr(int addr) { nodeAddr = addr; }
- void SetInDegree(int degree) { inDegree = degree; }
- void SetOutDegree(int degree) { outDegree = degree; }
- void SetColor(Color col) { nodeColor = col; }
- void SetNodeInfo(NodeConf* info) { nodeInfo = info; }
-
- private:
-
- int nodeId;
- int nodeAddr;
- int inDegree;
- int outDegree;
- Color nodeColor;
- NodeConf* nodeInfo;
-
-};
-
-// to derive from it specific node types
-class NodeConf {
-
- public:
-
- enum NodeType { AS_NODE = 1, RT_NODE = 2 };
- double GetCost() { return cost; }
- void SetCost(double c) { cost = c; }
- NodeType GetNodeType() { return type; }
- void SetNodeType(NodeType t) { type = t; }
- double GetCoordX() { return x; }
- double GetCoordY() { return y; }
- double GetCoordZ() { return z; }
- void SetCoord(double xval, double yval, double zval) {
- x = xval;
- y = yval;
- z = zval;
- }
-
- private:
-
- double cost;
- NodeType type;
- double x;
- double y;
- double z;
-
-};
-
-
-class RouterNodeConf : public NodeConf {
-
- public:
-
- RouterNodeConf();
- enum RouterNodeType { RT_NONE, RT_LEAF, RT_BORDER, RT_STUB, RT_BACKBONE };
- RouterNodeType GetRouterType() { return rttype; }
- void SetRouterType(RouterNodeType t) { rttype = t; }
- int GetASId() { return ASid; }
- void SetASId(int i) { ASid = i; }
-
- private:
-
- RouterNodeType rttype;
- int ASid;
-
-};
-
-class ASNodeConf : public NodeConf {
-
- public:
-
- enum ASNodeType {AS_NONE, AS_LEAF, AS_STUB, AS_BORDER, AS_BACKBONE};
- ASNodeConf();
- ~ASNodeConf();
- Topology* GetTopology() { return t; }
- void SetTopology(Topology* top, int asid);
- ASNodeType GetASType() { return astype; }
- void SetASType(ASNodeType t) { astype = t; }
- int GetASId() { return ASid; }
- void SetASId(int i) { ASid = i; }
-
- private:
-
- Topology* t;
- ASNodeType astype;
- int ASid;
-
-};
-
-} // namespace brite
-
-#endif /* NODE_H */
--- a/Topology.cc Tue Feb 22 13:17:57 2011 -0500
+++ b/Topology.cc Tue Feb 22 14:35:19 2011 -0500
@@ -318,7 +318,7 @@
/* Look for LEAF nodes */
for (int i = 0; i < g->GetNumNodes(); i++) {
- Node* node = g->GetNodePtr(i);
+ BriteNode* node = g->GetNodePtr(i);
assert(node != NULL);
if (node->GetOutDegree() <= m->GetMEdges()) {
@@ -341,8 +341,8 @@
/* Look for Stub Links */
for (el = g->edges.begin(); el != g->edges.end(); el++) {
- Node* Src = (*el)->GetSrc();
- Node* Dst = (*el)->GetDst();
+ BriteNode* Src = (*el)->GetSrc();
+ BriteNode* Dst = (*el)->GetDst();
assert(Src != NULL && Dst != NULL);
if ((Src->GetNodeInfo()->GetNodeType() == NodeConf::RT_NODE &&
((RouterNodeConf*)Src->GetNodeInfo())->GetRouterType() == RouterNodeConf::RT_LEAF) ||
@@ -368,7 +368,7 @@
for (int i = 0; i < g->GetNumNodes(); i++) {
/* if it has already being classified as a leaf, leaf it alone */
- Node* node = g->GetNodePtr(i);
+ BriteNode* node = g->GetNodePtr(i);
if (((node->GetNodeInfo()->GetNodeType() == NodeConf::RT_NODE) &&
(((RouterNodeConf*)(node->GetNodeInfo()))->GetRouterType() == RouterNodeConf::RT_LEAF)) ||
((node->GetNodeInfo()->GetNodeType() == NodeConf::AS_NODE) &&
@@ -422,8 +422,8 @@
/* Final classification of edges: Border and backbone links */
for (el = g->edges.begin(); el != g->edges.end(); el++) {
- Node* Src = (*el)->GetSrc();
- Node* Dst = (*el)->GetDst();
+ BriteNode* Src = (*el)->GetSrc();
+ BriteNode* Dst = (*el)->GetDst();
if (((((*el)->GetConf()->GetEdgeType() == EdgeConf::AS_EDGE) &&
((ASEdgeConf*)((*el)->GetConf()))->GetASEdgeType() != ASEdgeConf::AS_STUB)) ||
--- a/seed_file Tue Feb 22 13:17:57 2011 -0500
+++ b/seed_file Tue Feb 22 14:35:19 2011 -0500
@@ -1,5 +1,5 @@
-PLACES 5691 17539 31571
-CONNECT 52335 7037 25861
+PLACES 21311 45261 6792
+CONNECT 56599 46775 99
EDGE_CONN 53489 32975 5141
GROUPING 34898 48253 21264
ASSIGNMENT 44174 29196 31893