var model = monitor_model;
var name, count, best, monitor; 

if (typeof count =="undefined")
{
  count   = 0;
  best    = 1e99;
  name    = model.name();
  monitor = model.monitor('Potential');
  //monitor = model.monitor('Holm-Sander score');
}

var last = monitor.last_value();

if (last < best)
{
  best = last;
  model.save_as ('../Report/best_' + name + '.mlm');
}

count++;
best