Exemple #1
0
        private void InitSimulation()
        {
            v            = new Visualization(dimX, canvas, polytope);
            v.DrawPoints = drawPts;

            switch (polytope)
            {
            case Polytope.Simplex:
                d0             = Simplex.GenerateDistanceMatrix(dimX);
                minimalization = new GradientDescent(d0, alpha, Simplex.GetVerticesCount(dimX));
                //minimalization = new SimulatedAnnealing(1000, Simplex.GetVerticesCount(dimX), d0, dimY);
                break;

            case Polytope.Hypercube:
                d0             = Hypercube.GenerateDistanceMatrix(dimX);
                minimalization = new GradientDescent(d0, alpha, Hypercube.GetVerticesCount(dimX));
                //minimalization = new SimulatedAnnealing(1000, Hypercube.GetVerticesCount(dimX), d0, dimY);
                break;

            default:
                break;
            }

            mds = new MDS(MDS.EuclideanDistance, MDS.KruskalStress, minimalization);

            s = mds.InitPos();
            stressDisplay.Text = s.GetValue().ToString();
            DrawSolution(s, zoom);

            iterationDisplay.Text = "0";
        }