Examples of Piece


Examples of org.gudy.azureus2.plugins.peers.Piece

        if ( bad_pieces.contains(mi)){
         
          continue;
        }
       
        Piece  piece = pieces[i];
       
        if ( piece.isFullyAllocatable()){
     
          contiguous++;
         
          int  base_pri = base_priorities[i];
         
          if ( base_pri > contiguous_best_pri ){
           
            contiguous_best_pri  = base_pri;
          }
         
          for (int j=0;j<contiguous && j<contiguous_highest_pri.length;j++){
           
            if ( contiguous_best_pri > contiguous_highest_pri[j] ){
             
              contiguous_highest_pri[j= contiguous_best_pri;
              contiguous_best_pieces[j= i - j;
            }
           
            if ( j+1 > max_contiguous ){
               
              max_contiguous  = j+1;
            }
          }
   
        }else{
         
          contiguous      = 0;
          contiguous_best_pri  = -1;
         
          if ( max_contiguous == 0 ){
           
            int  free_reqs = piece.getAllocatableRequestCount();
           
            if ( free_reqs > max_free_reqs ){
             
              max_free_reqs     = free_reqs;
              max_free_reqs_piece  = i;
View Full Code Here

Examples of voodoo.framework.Piece

    init();
  }
 
  public Piece diff(Piece piece) {
    try {
      Piece diffPiece = new YouLosePiece();
      if(piece == null || !(piece instanceof YouLosePiece)) {
        throw new IllegalArgumentException();
      }
      for(String id : piece.getResourceIds()) {
        diffPiece.modifyResourceValue(id, (-1)*(piece.getResourceValue(id)));
      }
      return diffPiece;
    } catch (Exception e) {
      System.out.println(e.toString());
      return null;
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.