Beispiel #1
0
        private static void RunRandomInnerProduct(Random random)
        {
            ApproximationType approximation = new MultiplicativeUpperLowerApproximation(0.5, 2.0);
            int iterations   = 3000;
            var vectorLength = 1000;

            //var numOfNodes = 40;
            //for (int vectorLength = 100; vectorLength <= 3000; vectorLength += 100)
            for (int numOfNodes = 71; numOfNodes <= 71; numOfNodes += 10)
            {
                InnerProductRunner.RunRandomly(random, numOfNodes, approximation, vectorLength, iterations, resultDir);
            }
        }
Beispiel #2
0
        private static void RunTaxiTripsInnerProduct(Random random)
        {
            // NYC Coords
            // Big Square
            const double minLat  = 40.49;
            const double maxLat  = 40.91;
            const double minLong = -74.26;
            const double maxLong = -73.66;
            // Small Square

            /*const double minLat = 40.623;
             * const double maxLat = 40.846;
             * const double minLong = -74.04;
             * const double maxLong = -73.74;*/

            var nycCityRegion = new CityRegion(minLat, maxLat, minLong, maxLong);
            //var          sqrtNumOfNodes   = 5;
            //var          sqrtVectorLength = 10;
            var hoursInWindow      = 24;
            var iterations         = 750;
            var tipSplitter        = new DataSplitter <TaxiTripEntry>(entry => entry.Tip > 0, "Tip");
            var vendorSplitter     = new DataSplitter <TaxiTripEntry>(entry => entry.TaxiVendor == TaxiVendor.CMT, "Vendor");
            var paymentSplitter    = new DataSplitter <TaxiTripEntry>(entry => entry.PaymentType == PaymentType.Cash, "PaymentType");
            var passengersSplitter = new DataSplitter <TaxiTripEntry>(entry => entry.NumOfPassangers > 1, "Passengers");
            var splitters          = ArrayUtils.Init(tipSplitter, vendorSplitter, paymentSplitter, passengersSplitter);
            var approximation      = new MultiplicativeUpperLowerApproximation(0.7, 1.3);
            var chosenSplitter     = vendorSplitter;


            foreach (var sqrtVectorLength in ArrayUtils.Init(101))
            {
                // foreach (var sqrtVectorLength in ArrayUtils.Init(35, 61, 86, 100, 111, 122, 132, 141, 158, 173, 187, 200, 212, 223))
                //foreach (var sqrtNumOfNodes in ArrayUtils.Init(6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
                foreach (var sqrtNumOfNodes in ArrayUtils.Init(8))
                {
                    InnerProductRunner.RunTaxiTrips(random, iterations, sqrtNumOfNodes, hoursInWindow, approximation,
                                                    sqrtVectorLength, chosenSplitter, nycCityRegion, taxiBinDataPath, resultDir);
                }
            }
        }