1- function WeightedGraphTracer ( module ) {
2- if ( GraphTracer . call ( this , module || WeightedGraphTracer ) ) {
1+ function WeightedDirectedGraphTracer ( module ) {
2+ if ( DirectedGraphTracer . call ( this , module || WeightedDirectedGraphTracer ) ) {
33 initWeightedGraph ( ) ;
44 return true ;
55 }
66 return false ;
77}
88
9- WeightedGraphTracer . prototype = Object . create ( GraphTracer . prototype ) ;
10- WeightedGraphTracer . prototype . constructor = WeightedGraphTracer ;
9+ WeightedDirectedGraphTracer . prototype = Object . create ( DirectedGraphTracer . prototype ) ;
10+ WeightedDirectedGraphTracer . prototype . constructor = WeightedDirectedGraphTracer ;
1111
1212// Override
13- WeightedGraphTracer . prototype . clear = function ( ) {
14- GraphTracer . prototype . clear . call ( this ) ;
13+ WeightedDirectedGraphTracer . prototype . clear = function ( ) {
14+ DirectedGraphTracer . prototype . clear . call ( this ) ;
1515
1616 clearWeights ( ) ;
1717} ;
1818
19- var WeightedGraph = {
19+ var WeightedDirectedGraph = {
2020 random : function ( N , ratio , min , max ) {
2121 if ( ! N ) N = 5 ;
2222 if ( ! ratio ) ratio = .3 ;
@@ -39,7 +39,7 @@ var WeightedGraph = {
3939} ;
4040
4141// Override
42- WeightedGraphTracer . prototype . _setData = function ( G ) {
42+ WeightedDirectedGraphTracer . prototype . _setData = function ( G ) {
4343 if ( Tracer . prototype . _setData . call ( this , arguments ) ) return true ;
4444
4545 graph . clear ( ) ;
@@ -87,20 +87,20 @@ WeightedGraphTracer.prototype._setData = function (G) {
8787 return false ;
8888} ;
8989
90- GraphTracer . prototype . _weight = function ( target , weight , delay ) {
90+ DirectedGraphTracer . prototype . _weight = function ( target , weight , delay ) {
9191 this . pushStep ( { type : 'weight' , target : target , weight : weight } , delay ) ;
9292} ;
9393
94- GraphTracer . prototype . _visit = function ( target , source , weight ) {
94+ DirectedGraphTracer . prototype . _visit = function ( target , source , weight ) {
9595 this . pushStep ( { type : 'visit' , target : target , source : source , weight : weight } , true ) ;
9696} ;
9797
98- GraphTracer . prototype . _leave = function ( target , source , weight ) {
98+ DirectedGraphTracer . prototype . _leave = function ( target , source , weight ) {
9999 this . pushStep ( { type : 'leave' , target : target , source : source , weight : weight } , true ) ;
100100} ;
101101
102102//Override
103- WeightedGraphTracer . prototype . processStep = function ( step , options ) {
103+ WeightedDirectedGraphTracer . prototype . processStep = function ( step , options ) {
104104 switch ( step . type ) {
105105 case 'weight' :
106106 var targetNode = graph . nodes ( n ( step . target ) ) ;
@@ -124,7 +124,7 @@ WeightedGraphTracer.prototype.processStep = function (step, options) {
124124 printTrace ( visit ? source + ' -> ' + step . target : source + ' <- ' + step . target ) ;
125125 break ;
126126 default :
127- GraphTracer . prototype . processStep . call ( this , step , options ) ;
127+ DirectedGraphTracer . prototype . processStep . call ( this , step , options ) ;
128128 }
129129} ;
130130
0 commit comments