Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1.  
  2.     for ( uint32_t i = 0 ; i < 5 ; i++) {
  3.         for ( uint32_t j = 0 ; j < 5 ; j++) {
  4.             if ( i == j || j == i ) {
  5.                 NICM[i][j][2] = -1;
  6.             }
  7.             else {
  8.                 double linkProbability = 10.0;
  9.                 UniformVariable isLink_random(0,100);
  10.  
  11.                 if ( isLink_random.GetValue() <= linkProbability) {
  12.                     UniformVariable linkweight_random(0,101);
  13.                     NICM[i][j][2] = linkweight_random.GetInteger(0,100); // set the linkweight in the NICM to a random num 0-100
  14.                 }
  15.                 else {  // no link here so set to -1 in NICM
  16.                     NICM[i][j][2] = -1;
  17.                 }
  18.             }
  19.  
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement