// file: tr_path_4.cc
//

// isip include files
//
#include "trace.h"
#include "trace_constants.h"

// method: compare_cc
//
// arguments:
//  Trace* trace : (input) the other trace
//
// return: a Trace* containing the better trace
//
// this method checks if two traces at the phone or state level can be
// compared, and if they are at the same level and can be compared, it
// returns which of them is better
//
Trace* Trace::compare_cc(Trace* trace_a) {

  // dummy variables
  //
  Trace* better_path = (Trace*)NULL;
  
  // make sure these traces pertain to the same position in the search
  // space
  //
  if (instance_d == trace_a->instance_d) {

    // compare the scores
    //
    if (score_d > trace_a->score_d) {
      better_path = this;
    }
    else {
      better_path = trace_a;
    }
  } // end if same search space location
  
  // exit gracefully
  //
  return better_path;
}
