gstate set_rightneigbor(gstate state, int x, int y, gstate grid[MAX_X][MAX_Y]);
1 2 3 4 (x,y)=(0,0) The coordinates are (0,0) and the solicited matrix entry is: 1 IS IT OCCUPIED??? It's occupied, the trial ends. Choose another site again 5 6 7 8 (x,y)=(0,1) The coordinates are (0,1) and the solicited matrix entry is: 6 IS IT OCCUPIED??? It's empty. Let's go to generate a random number to choose the adsorbates random q= 0.663232 q = 0.663232 is greater than xco = 0.400000. We choose NO r= 0.045448 r= 0.045448 is less than rno= 0.600000 We seek another neighbor to decide if NO can disociate FIND THE NEIGHBORS SO THAT NO CAN BE DISOCIATED Right: 5 Left: 5 Up: 8 Down: 8 ****WE DIDN'T FIND AN EMPTY NEIGHBOR SO,THE TRIAL ENDS, START AGAIN**** 9 10 11 12 (x,y)=(1,0) The coordinates are (1,0) and the solicited matrix entry is: 11 IS IT OCCUPIED??? It's empty. Let's go to generate a random number to choose the adsorbates random q= 0.896695 q = 0.896695 is greater than xco = 0.400000. We choose NO r= 0.358901 r= 0.358901 is less than rno= 0.600000 We seek another neighbor to decide if NO can disociate FIND THE NEIGHBORS SO THAT NO CAN BE DISOCIATED Right: 12 Left: 12 Up: 9 Down: 9 ****WE DIDN'T FIND AN EMPTY NEIGHBOR SO,THE TRIAL ENDS, START AGAIN**** 13 14 15 16 (x,y)=(0,0) The coordinates are (0,0) and the solicited matrix entry is: 13 IS IT OCCUPIED??? It's empty. Let's go to generate a random number to choose the adsorbates random q= 0.540815 q = 0.540815 is greater than xco = 0.400000. We choose NO r= 0.274174 r= 0.274174 is less than rno= 0.600000 We seek another neighbor to decide if NO can disociate FIND THE NEIGHBORS SO THAT NO CAN BE DISOCIATED Right: 14 Left: 14 Up: 15 Down: 15 ****WE DIDN'T FIND AN EMPTY NEIGHBOR SO,THE TRIAL ENDS, START AGAIN**** 17 18 19 20 (x,y)=(1,1) The coordinates are (1,1) and the solicited matrix entry is: 20 IS IT OCCUPIED??? It's empty. Let's go to generate a random number to choose the adsorbates random q= 0.474475 q = 0.474475 is greater than xco = 0.400000. We choose NO r= 0.114339 r= 0.114339 is less than rno= 0.600000 We seek another neighbor to decide if NO can disociate FIND THE NEIGHBORS SO THAT NO CAN BE DISOCIATED Right: 19 Left: 19 Up: 18 Down: 18 ****WE DIDN'T FIND AN EMPTY NEIGHBOR SO,THE TRIAL ENDS, START AGAIN**** 21 22 23 24 (x,y)=(1,1) The coordinates are (1,1) and the solicited matrix entry is: 24 IS IT OCCUPIED??? It's empty. Let's go to generate a random number to choose the adsorbates random q= 0.141615 CO is adsorbed adsorbed CO ---> co = 1 FIND THE NEIGHBORS OF THE ADSORBED CO Right: 23 Left: 23 Up: 22 Down: 22 It wasn't encountered a site with O :( CO2 IS NOT PRODUCED
//EVALUATE IF THE CHOSEN SITE IS EITHER EMPTY OR OCCUPIED printf("IS IT OCCUPIED???\n\n\n"); //random = (double) rand () / RAND_MAX; //printf("random = %lf\n\n",random); // Include particle based on the probability check: if (grid[y][x] == occupied){ printf("It's occupied, the trial ends. Choose another site again\n\n"); goto step1; } else{ if (grid[y][x] == empty){ printf("It's empty. Let's go to generate a random number to choose the adsorbates\n\n"); goto step2; } }