Alex Bikfalvi
SimStream Documentation
TopoBriteEdge.cpp
00001 #include "Headers.h" 00002 #include "TopoBriteEdge.h" 00003 00004 CTopoBriteEdge::CTopoBriteEdge( 00005 __uint32 id, 00006 __uint32 node1, 00007 __uint32 node2, 00008 double length, 00009 double delay, 00010 __bitrate bandwidth 00011 ) 00012 { 00013 this->id = id; 00014 this->nodes[0] = node1; 00015 this->nodes[1] = node2; 00016 this->length = length; 00017 this->delay = delay; 00018 this->bandwidth = bandwidth; 00019 } 00020 00021 CTopoBriteEdge::~CTopoBriteEdge() 00022 { 00023 } 00024 00025 double CTopoBriteEdge::Cost() 00026 { 00027 return 100000000.0 / this->bandwidth; 00028 } 00029 00030 __uint32 CTopoBriteEdge::OtherNode(__uint32 node) 00031 { 00032 assert((this->nodes[0] == node) || (this->nodes[1] == node)); 00033 00034 return (this->nodes[0] == node)?this->nodes[1]:this->nodes[0]; 00035 }
Last updated: February 8, 2011