Project

General

Profile

Revision 182

Wireless analysis done for up to 5 robots.

View differences:

analysis.c
210 210
		join_count += robots[i].join_count;
211 211
	}
212 212

  
213
	int join_average = join_time / join_count;
214
	int token_held_average = token_held_time / token_passed_count;
215
	int token_waiting_average = token_waiting_time / token_passed_count;
216
	int token_delay_average = token_delay_time / token_passed_count;
213
	int join_average = 0;
214
	if (join_count != 0)
215
		join_average = join_time / join_count;
216
	int token_held_average = 0, token_waiting_average = 0, token_delay_average = 0;
217
	if (token_passed_count != 0)
218
	{
219
		token_held_average = token_held_time / token_passed_count;
220
		token_waiting_average = token_waiting_time / token_passed_count;
221
		token_delay_average = token_delay_time / token_passed_count;
222
	}
217 223

  
218 224
	// display information
219 225
	printf("Robots:\t\t\t\t\t\t%d\n", num_robots);

Also available in: Unified diff