Examples of ProgramFrame


Examples of tvbrowserdataservice.file.ProgramFrame

   
    // Compare each raw program with each prepared program and build a
    // similarity matrix
    double[][] similarity = new double[progList.size()][unmappedList.size()];
    for (int i = 0; i < progList.size(); i++) {
      ProgramFrame prepFrame = progList.get(i);
      for (int j = 0; j < unmappedList.size(); j++) {
        ProgramFrame rawFrame = unmappedList.get(j);
        similarity[i][j] = getSimilarity(prepFrame, rawFrame);
      }
    }
   
    // Use the similarity matrix to map all programs that are similar
    double maxSimilarity;
    do {
      // Find the programs that have the maximum similarity
      maxSimilarity = 0;
      int maxI = 0;
      int maxJ = 0;
     
      for (int i = 0; i < progList.size(); i++) {
        for (int j = 0; j < unmappedList.size(); j++) {
          if (similarity[i][j] > maxSimilarity) {
            // We have a new maximum
            maxSimilarity = similarity[i][j];
            maxI = i;
            maxJ = j;
          }
        }
      }
     
      // map the programs
      if (maxSimilarity > 0) {
        ProgramFrame prepFrame = progList.get(maxI);
        ProgramFrame rawFrame = unmappedList.get(maxJ);
        rawFrame.setId(prepFrame.getId());
       
        // Set the similarities of these programs to 0 to avoid a second match
        for (int i = 0; i < progList.size(); i++) {
          similarity[i][maxJ] = 0;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.