Package _io

Examples of _io.ReadBinaryClusterIdStream


   
    int inPointer = 0;
    for(int i = 0; i < (Card.NUM_CARDS-1); i++) {
      for(int j = i+1; j < Card.NUM_CARDS; j++) {
        String path = inputDir + new Integer(i).toString() + "_" + new Integer(j).toString();
        in[inPointer++] = new ReadBinaryClusterIdStream(
            path,
            0,
            Helper.getBufferSize(MAX_SIMULT_FILES_OPEN));
      }
    }
View Full Code Here


        // load up our two input files -- (x) bc's and (x+1) bc's
        // ------------------------------------------------------------
        String inputPath1 = getInputFileName(numBoardCards1, holeCards);
        String inputPath2 = getInputFileName(numBoardCards2, holeCards);

        ReadBinaryClusterIdStream in1 =
          new ReadBinaryClusterIdStream(inputPath1, numBoardCards1, Helper.getBufferSize(MAX_SIMULT_FILES_OPEN));
        ReadBinaryClusterIdStream in2 =
          new ReadBinaryClusterIdStream(inputPath2, numBoardCards2, Helper.getBufferSize(MAX_SIMULT_FILES_OPEN));
       
       
        // ------------------------------------------------------------
        // load up output file
        // ------------------------------------------------------------
        String outputPath = getOutputFileName(numBoardCards1, holeCards);
        Helper.prepFilePath(outputPath);
       
        WriteBinaryClusterIDTableStream out =
          new WriteBinaryClusterIDTableStream(
          outputPath, numBoardCards1, numBoardCards2, holeCards,
          in1.getNumClusters(), in2.getNumClusters(),
          Helper.getBufferSize(MAX_SIMULT_FILES_OPEN));
       
       

       
        // ------------------------------------------------------------
        // read input for numBoardCards2 into array for random access
        // ------------------------------------------------------------
        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++) {
View Full Code Here

TOP

Related Classes of _io.ReadBinaryClusterIdStream

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.