// returns a string telling the error, or "" if no error
 public string AddMetric(Activity activity, Metric metric)
 {
     if (activity.MetricForName(metric.Name) != null)
     {
         return("Activity " + activity.Name + " already has metric " + metric.Name);
     }
     activity.AddIntrinsicMetric(metric);
     this.MetricAdded.Invoke(metric, activity);
     return("");
 }