FACT++  1.0
void RemoveMiniSources ( vector< Source > &  obs)

Definition at line 441 of file makeschedule.cc.

References i.

Referenced by main().

442 {
443  for (size_t i=1; i<obs.size()-1; i++)
444  {
445  if (obs[i].duration()>=5./24/60)
446  continue;
447 
448  if (obs[i-1].name=="SLEEP" && obs[i+1].name=="SLEEP")
449  continue;
450 
451  cout << "Mini source [" << obs[i].name << "] detected < 5min" << endl;
452 
453  if (obs[i-1].name=="SLEEP" && obs[i+1].name=="SLEEP")
454  {
455  obs[i-1].end = obs[i+2].begin;
456 
457  obs.erase(obs.begin()+i+1);
458  obs.erase(obs.begin()+i);
459 
460  i -= 2;
461 
462  cout << "Combined two surrounding sleep into one" << endl;
463 
464  continue;
465  }
466 
467  if (obs[i-1].name=="SLEEP")
468  {
469  obs[i-1].end = obs[i+1].begin;
470  obs.erase(obs.begin()+i);
471  i--;
472 
473  cout << "Extended previous sleep" << endl;
474 
475  continue;
476  }
477 
478  if (obs[i+1].name=="SLEEP")
479  {
480  obs[i+1].begin = obs[i-1].end;
481  obs.erase(obs.begin()+i);
482 
483  cout << "Extended following sleep" << endl;
484 
485  i--;
486  continue;
487  }
488  }
489 }
int i
Definition: db_dim_client.c:21

+ Here is the caller graph for this function: