distance to object fitness function