Ejemplo n.º 1
0
        public static void generateOnly()
        {
            Data data = FileHelper.loadData(inputData);

            Console.WriteLine("WCZYTANO PLIK " + inputData + "\n");
            Console.WriteLine(data);
            Dice      dice  = new Dice(data);
            GameState first = new GameState(data);
            Stopwatch sw    = new Stopwatch();

            sw.Start();
            Console.WriteLine("GENERUJE STANY WYGRANYCH i PRZEGRANYCH :");
            GameStateGenerator generator = new GameStateGenerator(first, dice);

            sw.Stop();
            Console.WriteLine("WYGENEROWANO " + generator.allStates.Count + " STANOW GRY");
            Console.WriteLine("W CZASIE : " + sw.ElapsedMilliseconds);
            Console.WriteLine("ZAPISUJE WYGENEROWANĄ MACIERZ I WEKTOR...");
            generator.generateMatrixToFile(matrixOutput);
            Console.WriteLine("SKONCZYLEM ZAPISYWAC MACIERZ");
            MyMatrix vector = generator.generateVector();

            FileHelper.saveMatrix(vectorOutput, vector);
            Console.WriteLine("SKOCZYLEM ZAPISYWAC WEKTOR");
            FileHelper.countAndSaveVectorOfNonZeroElements(matrixOutput, vectorNonZeroOutput);
            Console.WriteLine("SKONCZYLEM ZAPISYWAC WEKTOR NON ZERO");
        }
Ejemplo n.º 2
0
        public static void info()
        {
            MyMatrix.epsilon = epsilon;
            Stopwatch watch = new Stopwatch();

            Console.WriteLine("EPSILON : " + MyMatrix.epsilon);
            Data data = FileHelper.loadData(inputData);

            Console.WriteLine("WCZYTANO PLIK " + inputData + "\n");
            Console.WriteLine(data);
            Dice      dice  = new Dice(data);
            GameState first = new GameState(data);

            watch.Start();
            GameStateGenerator generator = new GameStateGenerator(first, dice);
            MyMatrix           matrix    = generator.generateMatrix();
            MyMatrix           vector    = generator.generateVector();

            watch.Stop();
            Console.WriteLine("WYGENEROWANO " + generator.allStates.Count + " STANOW GRY");
            Console.WriteLine("W CZASIE : " + watch.ElapsedMilliseconds + "\n");
            double generationTime = watch.ElapsedMilliseconds;

            Console.WriteLine("ZAPISUJE WYGENEROWANĄ MACIERZ I WEKTOR...");
            FileHelper.saveMatrixSparse(matrixOutput, matrix);
            FileHelper.saveMatrix(vectorOutput, vector);
            FileHelper.saveVectorOfNonZeroElements(vectorNonZeroOutput, matrix);
            Console.WriteLine("SKONCZYLEM ZAPISYWAC...\n");
            countInfo(matrix, vector, generationTime);
        }