Esempio n. 1
0
        public Tracking(int K,
		                 int rampPointPercent,
		                 int rampedMaxDegree)
        {
            _K = K;
            _generatedCount = 0;
            _generatedNeighboursCounter = new List<int> (K);

            _rampPoint = (K * rampPointPercent) / 100;
            _rampedMaxDegree = rampedMaxDegree;
            if (_rampedMaxDegree > K)
            {
                _rampedMaxDegree = K;
            }
            _rampedDegreeSelector = new CryptoRNGHelper ();
            _neighbourSelector = new CryptoRNGHelper ();

            _currentDegree = 1;
            _currentNeighbours = null;

            for (int n=0; n<K; n++)
            {
                _generatedNeighboursCounter.Add (0);
            }
        }
Esempio n. 2
0
        public SolitonEncoder(byte[] data, int blockSize)
        {
            if (blockSize <= 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            Data = data;
            Size = data.Length;
            K = (int)Math.Ceiling ((double)data.Length / (double)blockSize);
            BlockSize = blockSize;
            _neighbourSelector = new CryptoRNGHelper ();

            _dist = new Soliton (this.K, 0.0012, 0.0001);

            byte[] padded = Pad (data);
            _data = Split (padded);
        }