fn total_distance(billboard : &[Node]) -> f32{

	let mut distance_accumulator : f32 = 0.0;
	let max_index = billboard.len() - 1;

	//Compute sum of all distances except from last to first.
	//In Rust for loops, the upper bound is excluded. Therefore:
	//	max(index) will be billboard.len()-1-1 = 280-2 = 278
	//So the for loop will compute the sum till index 279
	for index in 0..max_index {
		distance_accumulator += distance(index as usize, index+1 as usize, billboard);
	}
	//Add 279 to 0
	distance_accumulator += distance(max_index as usize, 0 as usize, billboard);

	distance_accumulator
}
//Return the total distance of the tour (cyclical tour, so max->0 is included)
Return the total distance of the tour (cyclical tour, so max->0 is included)
Return the total distance of the tour ( cyclical tour so max - > 0 is included )
fn total_distance(billboard : &[Node]) -> f32{
	let mut distance_accumulator : f32 = 0.0;
	let max_index = billboard.len() - 1;
	//Compute sum of all distances except from last to first.
	//In Rust for loops, the upper bound is excluded. Therefore:
	//	max(index) will be billboard.len()-1-1 = 280-2 = 278
	//So the for loop will compute the sum till index 279
	for index in 0..max_index {
		distance_accumulator += distance(index as usize, index+1 as usize, billboard);
	}
	//Add 279 to 0
	distance_accumulator += distance(max_index as usize, 0 as usize, billboard);
	distance_accumulator
}
fn total_distance ( billboard : & [ Node ] ) -> f32 { let mut distance_accumulator : f32 = 0.0 ; let max_index = billboard . len ( ) - 1 ; //Compute sum of all distances except from last to first. //In Rust for loops, the upper bound is excluded. Therefore: //	max(index) will be billboard.len()-1-1 = 280-2 = 278 //So the for loop will compute the sum till index 279 for index in 0 .. max_index { distance_accumulator += distance ( index as usize , index + 1 as usize , billboard ) ; } //Add 279 to 0 distance_accumulator += distance ( max_index as usize , 0 as usize , billboard ) ; distance_accumulator }
Return the total distance of the tour (cyclical tour, so max->0 is included)
Return the total distance of the tour ( cyclical tour so max - > 0 is included )
billboard
&[Node]
billboard
&[Node]