Пример #1
0
        protected override void PrepareTestData()
        {
            base.PrepareTestData();

            // start = 0
            // end = 1
            int firstPathLength  = (testSize - 2) / 2;
            int secondPathLength = testSize - 2 - firstPathLength;

            List <ExchangePair> edges = new List <ExchangePair>();
            List <int>          firstPath, secondPath;

            firstPath  = new List <int>(new int[] { 0, 1 });
            secondPath = new List <int>(new int[] { 0, 1 });
            firstPath.InsertRange(1, Enumerable.Range(2, firstPathLength));
            secondPath.InsertRange(1, Enumerable.Range(firstPathLength + 2, secondPathLength));

            edges.AddRange(CurrencyGraphHelper.ConstructPath(2057 * testNumber,
                                                             firstPath.ToArray(),
                                                             expectedBestPrices));
            edges.AddRange(CurrencyGraphHelper.ConstructPath(3043 * testNumber,
                                                             secondPath.ToArray(),
                                                             expectedBestPrices));
            exchanges = edges.ToArray();
        }
Пример #2
0
        protected override void PrepareTestData()
        {
            base.PrepareTestData();

            int                 cycleLength = testSize / 2;
            int                 pathLength  = testSize - cycleLength + 1;
            List <int>          cycle       = new List <int>(Enumerable.Range(0, cycleLength));
            List <ExchangePair> edges       = new List <ExchangePair>();

            edges.AddRange(CurrencyGraphHelper.ConstructCycle(6171 * testNumber,
                                                              cycle.ToArray(),
                                                              expectedBestPrices,
                                                              true));
            edges.AddRange(CurrencyGraphHelper.ConstructPath(7291 * testNumber,
                                                             Enumerable.Range(cycle.Last(), pathLength).Reverse().ToArray(),
                                                             null));

            cycle.Add(0);
            for (int i = 0; i < testSize; i++)
            {
                expectedBestPrices[i]      = null;
                expectedArbitrages[i]      = true;
                expectedArbitrageCycles[i] = cycle.ToArray();
            }
            exchanges = edges.ToArray();
        }
Пример #3
0
 protected override void PrepareTestData()
 {
     base.PrepareTestData();
     exchanges = CurrencyGraphHelper.ConstructPath(1013 * testNumber,
                                                   Enumerable.Range(0, testSize).Reverse().ToArray(),
                                                   expectedBestPrices).ToArray();
 }