|
|
| version 1.1.1.1, 2012/02/21 17:26:11 | version 1.1.1.2, 2016/11/02 10:09:10 |
|---|---|
| Line 1 | Line 1 |
| #include <zebra.h> | |
| #include <stdio.h> | #include <stdio.h> |
| #include <stdlib.h> | #include <stdlib.h> |
| #include <string.h> | #include <string.h> |
| #include "random.c" | #include "random.c" |
| #include <zebra.h> | |
| #include "thread.h" | #include "thread.h" |
| #include "vty.h" | #include "vty.h" |
| #include "log.h" | #include "log.h" |
| Line 50 long X, /* horizontal size of grid */ | Line 50 long X, /* horizontal size of grid */ |
| long x, | long x, |
| y, | y, |
| y1, y2, yp, | yy1, yy2, yyp, |
| dl, dx, xn, yn, count, | dl, dx, xn, yyn, count, |
| *mess; | *mess; |
| double n; | double n; |
| Line 670 gen_spgrid_topology (struct vty *vty, struct list *top | Line 670 gen_spgrid_topology (struct vty *vty, struct list *top |
| for ( k = ax; k > 0; k -- ) | for ( k = ax; k > 0; k -- ) |
| { | { |
| y1 = nrand ( Y ); | yy1 = nrand ( Y ); |
| do | do |
| y2 = nrand ( Y ); | yy2 = nrand ( Y ); |
| while ( y2 == y1 ); | while ( yy2 == yy1 ); |
| i = NODE ( x, y1 ); | i = NODE ( x, yy1 ); |
| j = NODE ( x, y2 ); | j = NODE ( x, yy2 ); |
| l = am + nrand ( al ); | l = am + nrand ( al ); |
| print_arc (vty, topology, i, j, l ); | print_arc (vty, topology, i, j, l ); |
| } | } |
| Line 711 gen_spgrid_topology (struct vty *vty, struct list *top | Line 711 gen_spgrid_topology (struct vty *vty, struct list *top |
| dx = xn - x; | dx = xn - x; |
| if ( ip_f ) | if ( ip_f ) |
| { | { |
| yp = nrand(Y-y); | yyp = nrand(Y-y); |
| yn = mess[ yp ]; | yyn = mess[ yyp ]; |
| mess[ yp ] = mess[ Y - y - 1 ]; | mess[ yyp ] = mess[ Y - y - 1 ]; |
| } | } |
| else | else |
| yn = y; | yyn = y; |
| j = NODE ( xn, yn ); | j = NODE ( xn, yyn ); |
| l = im + nrand ( il ); | l = im + nrand ( il ); |
| if ( in != 0 ) | if ( in != 0 ) |
| l *= (long) ( in * dx ); | l *= (long) ( in * dx ); |