public void Setup()
 {
     _id.BitField.SetAll(true);
     _tester = new TestPicker();
     _picker = new PriorityPicker(_tester);
     _picker.Initialise(_rig.Manager.Bitfield, _rig.Torrent.Files, new List <Piece>());
     foreach (TorrentFile file in _rig.Torrent.Files)
     {
         file.Priority = Priority.Normal;
     }
 }
Beispiel #2
0
        public void Setup()
        {
            tester = new TestPicker();
            rarest = new RarestFirstPicker(tester);
            rarest.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List <Piece>());
            peers = new List <PeerId>();
            for (int i = 0; i < 5; i++)
            {
                peers.Add(new PeerId(new Peer(new string((char)(i + 'a'), 20), new Uri("tcp://aaa")), rig.Manager));
            }

            for (int i = 0; i < rig.Manager.Bitfield.Length; i++)
            {
                for (int j = 0; j < peers.Count; j++)
                {
                    peers[j].BitField[i] = i % (j + 1) == 0;
                }
            }
            peers[0].BitField.SetAll(true);
        }
Beispiel #3
0
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }