public class RandomizedRarestFirstSelector extends RarestFirstSelector
Constructor and Description |
---|
RandomizedRarestFirstSelector() |
Modifier and Type | Method and Description |
---|---|
protected int |
getIterationIdx(int i) |
IntStream |
getNextPieces(BitSet relevantChunks,
PieceStatistics pieceStatistics)
Select pieces based on the chunks which are relevant.
|
void |
initSelector(int numPieces)
Init any structures to iterate through numPieces pieces in some iteration order
|
randomizedRarest, rarest
public void initSelector(int numPieces)
PieceSelector
numPieces
- the number of pieces totalprotected int getIterationIdx(int i)
getIterationIdx
in class RarestFirstSelector
public IntStream getNextPieces(BitSet relevantChunks, PieceStatistics pieceStatistics)
PieceSelector
getNextPieces
in interface PieceSelector
getNextPieces
in class RarestFirstSelector
relevantChunks
- the relevant chunks to chose (in the peer's completed list,pieceStatistics
- the piece statisticsCopyright © 2016–2021. All rights reserved.