please use [COLOR="Blue"][code][/code][/COLOR] to keep formatting of your code.
The message: awk: e2edelay.awk:77: (FILENAME=simple_aodv.tr FNR=36530) Fatal:division by zero attempted means: the error occured in the line 77 of the script e2edelay.awk, and using the line 36530 of the tracefile. Probably that line contains invalid data, or it has invalid format, I cannot check it.
The code you posted does contain a division in line 77, the error message means the variable count is zero. The variable count is only modified in line 53, but only if the condition in line 49 was true (end_time[i] > 0). Looks like it never happened.