code: function getDepth(history) {
      var total= history[0];
      for (var n=1; n < history.length; n++) {
          total = total + (n * n * history[n]);
      }
      var result = total / agents.length;
  //    console.log("total=" + total+", result=" + result);
      return result;
  }
docs: find the average search depth. Include the null entries for cost.
  
  @param history of hash table.
  @rtype Number.