Package stage1

Examples of stage1.HandRecordScoreGroups


          Helper.prepFilePath(outPath);
          WriteBinaryScoreGroupStream out = new WriteBinaryScoreGroupStream(outPath,
              numBoardCards, in.getHoleCards(), NUM_SCORE_GROUPS[numBoardCards],
              Helper.getBufferSize(MAX_SIMULT_FILES_OPEN));
         
          HandRecord hrsm;

          while((hrsm = in.readRecord()) != null) {
            short[] sample;
            sample = handRecordScoreMapToArray((HandRecordScoreMap) hrsm, numBoardCards);
            out.putScoreGroup(sample);
View Full Code Here


    if(numBoardCards != (byte)header[2]) {
      throw new RuntimeException("not right number of board cards");
    }

    ScoreMaps sm = new ScoreMaps((byte)numBoardCards, holeCards);
    HandRecord iterator = new HandRecord(numBoardCards, holeCards);
    short length;
    short score;
    int count;
   
    // THIS CODE HAS BEEN TESTED -- DO NOT TOUCH!!!!!!!!!!!!!!!!!!!!
    while(iterator.hasMoreElements) {
      iterator.advanceRecord();
     
      length = dis.readShort();
     
      for(int i = 0; i < length/6; i++) {
        score = dis.readShort();
View Full Code Here

    for(int i = 0; i < 10; i++) {
      out.writeShort(header[i]);
    }
   
   
    HandRecord iterator = new HandRecord(numBoardCards, holeCards);
   
    int numScores = 0;
    int numHands = 0;
    int numScoresBySize = 0;

    // THIS CODE HAS BEEN TESTED -- DO NOT TOUCH!!!!!!!!!!!!!!!!!!!!
    while(iterator.hasMoreElements) {
      iterator.advanceRecord();
     
//       doing the lookups against our iterator ensures proper ordering
      Map mapToWrite = in.getScoreMapWithCards(iterator);
      numHands++;
     
View Full Code Here

      out.writeShort(header[i]);
    }
   
   
    //set up iterator
    iterator = new HandRecord(numBoardCards, holeCards);
  }
View Full Code Here

        byte[][][][][] newClusterIds = new byte[Card.NUM_CARDS+1]
                            [Card.NUM_CARDS+1]
                             [Card.NUM_CARDS+1]
                              [Card.NUM_CARDS+1]
                               [Card.NUM_CARDS+1];
        HandRecordClusterId hr2;
        double arrayPopulateTimer = System.currentTimeMillis();
        int numEntriesToPopulate = Constants.choose(Card.NUM_CARDS-2, numBoardCards2);
        int modVal = (int)Math.floor(numEntriesToPopulate/100);

        if(isFiveBcs) {
          int counter = 0;
          int percent = 0;
          while((hr2 = in2.readRecord()) != null) {
            byte[] boardCards2Copy = hr2.boardCards;
            newClusterIds[boardCards2Copy[0]]
                    [boardCards2Copy[1]]
                     [boardCards2Copy[2]]
                    [boardCards2Copy[3]]
                     [boardCards2Copy[4]] = hr2.clusterId;
            if(++counter % modVal == 0) {
//              System.out.println("  " + (percent++) + "% done populating array");
            }
          }
        } else {
          while((hr2 = in2.readRecord()) != null) {
            byte[] boardCards2Copy = new byte[5];
            for(int i = 0; i < numBoardCards2; i++) {
              boardCards2Copy[i] = hr2.boardCards[i];
            }
            for(int i = numBoardCards2; i < 5; i++) {
              boardCards2Copy[i] = Card.NUM_CARDS;
            }
            newClusterIds[boardCards2Copy[0]]
                    [boardCards2Copy[1]]
                     [boardCards2Copy[2]]
                    [boardCards2Copy[3]]
                     [boardCards2Copy[4]] = hr2.clusterId;
          }
        }
//        System.out.println("    load array: " +
//            (System.currentTimeMillis() - arrayPopulateTimer));
       
       
        // ------------------------------------------------------------
        // create output
        // ------------------------------------------------------------
       
        // for each (50 choose numBoardCards1) ...
        //   print clusterId for numBoardCards1
        //   loop through all possible (50 choose numBoardCards2) boardcards,
        //     merge each one with our holecards to get the candidates for the
        //     next card-turn.  For each of those, look up the cluster ID for
        //     these holecards and print that out
       
        HandRecordClusterId hr1;
       
        // each output sequence (for each boardCard config) will now:
        //  1) be the same length
        //  2) be in the same order, given the boardcards
        // output cluster ID will only be Byte.MAX_VALUE if the newly delt
View Full Code Here

    if(numBoardCards != (byte)header[2]) {
      throw new RuntimeException("not right number of board cards");
    }
    this.numClusters = header[3];
   
    nextRec = new HandRecordClusterId(numBoardCards, holeCards);
  }
View Full Code Here

    if(numBoardCards != (byte)header[2]) {
      throw new RuntimeException("not right number of board cards");
    }
    m_numScoreGroups = header[3];
   
    m_nextRec = new HandRecordScoreGroups(m_numBoardCards, m_holeCards, m_numScoreGroups);
  }
View Full Code Here

    byte[] holeCards = new byte[] { (byte)header[0], (byte)header[1] };
    if(numBoardCards != (byte)header[2]) {
      throw new RuntimeException("not right number of board cards");
    }

    ScoreMaps sm = new ScoreMaps((byte)numBoardCards, holeCards);
    HandRecord iterator = new HandRecord(numBoardCards, holeCards);
    short length;
    short score;
    int count;
   
    // THIS CODE HAS BEEN TESTED -- DO NOT TOUCH!!!!!!!!!!!!!!!!!!!!
    while(iterator.hasMoreElements) {
      iterator.advanceRecord();
     
      length = dis.readShort();
     
      for(int i = 0; i < length/6; i++) {
        score = dis.readShort();
        count = dis.readInt();
        sm.addScoreCountFromFile(iterator, score, count);
      }
    }
   
    dis.close();
View Full Code Here

TOP

Related Classes of stage1.HandRecordScoreGroups

Copyright © 2018 www.massapicom. 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.