Package java.util

Examples of java.util.Random.nextDouble()


            for (int i = 2; i <= 20; i++) {
                ArrayList<Segment> segments = new ArrayList<Segment>();

                for(int j = 0; j < i; j++) {
                    segments.add(new Segment(new Point(rand.nextDouble()*100, rand.nextDouble()*100),
                                             new Point(rand.nextDouble()*100, rand.nextDouble()*100)));
                }

                assertTrue(SegmentsIntersect.any(segments) ==
                            SegmentsIntersect.any_Naive(segments));
            }
View Full Code Here


        Random r = new Random();
        int k;
        T temp;
       
        do {
            k = (int)(j*r.nextDouble());
           
            temp = res.get(k);
            res.set(k, res.get(j-1));
            res.set(j-1, temp);
           
View Full Code Here

        if (!Locations.hasDLInitialized) {
            Benchmark.start("DlUtils");
            Logger.logInfo("DownloadUtils.run() starting");
            downloadServers.put("Automatic", Locations.masterRepoNoHTTP);
            Random r = new Random();
            double choice = r.nextDouble();
            try { // Super catch-all to ensure the launcher always renders
                try {
                    // Fetch the percentage json first
                    String json = IOUtils.toString(new URL(Locations.masterRepo + "/FTB2/static/balance.json"));
                    JsonElement element = new JsonParser().parse(json);
View Full Code Here

       
        for (int n = 3; n <= 20; n++) {
            ArrayList<Point> points = new ArrayList<Point>();
           
            for(int i = 0; i < n; i++) {
                points.add(new Point(rand.nextDouble()*100,
                                     rand.nextDouble()*100));
            }
       
            checkConvexHull(points);
        }
View Full Code Here

        for (int n = 3; n <= 20; n++) {
            ArrayList<Point> points = new ArrayList<Point>();
           
            for(int i = 0; i < n; i++) {
                points.add(new Point(rand.nextDouble()*100,
                                     rand.nextDouble()*100));
            }
       
            checkConvexHull(points);
        }
    }
View Full Code Here

       
        for (int n = 3; n <= 100; n++) {
            ArrayList<Point> points = new ArrayList<Point>();
           
            for(int i = 0; i < n; i++) {
                points.add(new Point(rand.nextDouble()*100,
                                     rand.nextDouble()*100));
            }
       
            checkClosestPair(points);
        }
View Full Code Here

        for (int n = 3; n <= 100; n++) {
            ArrayList<Point> points = new ArrayList<Point>();
           
            for(int i = 0; i < n; i++) {
                points.add(new Point(rand.nextDouble()*100,
                                     rand.nextDouble()*100));
            }
       
            checkClosestPair(points);
        }
    }
View Full Code Here

        points.add(new Point(-3, 3));
        points.add(new Point(3, -3));
        points.add(new Point(3, 3));

        for (int i = 0; i < 1000; i++) {
            points.add(new Point(rand.nextDouble()*6-3, rand.nextDouble()*6-3));
        }

        // Triangulate (Delaunay)
        ArrayList<Triangle> triangulation = Delaunay.randomizedIncremental(points);
    }
View Full Code Here

        points.add(new Point(-3, 3));
        points.add(new Point(3, -3));
        points.add(new Point(3, 3));

        for (int i = 0; i < 1000; i++) {
            points.add(new Point(rand.nextDouble()*6-3, rand.nextDouble()*6-3));
        }

        // Triangulate (Delaunay)
        ArrayList<Triangle> triangulation = Delaunay.randomizedIncremental(points);
    }
View Full Code Here

                points.add(new ProjectedPoint3D(-3, 3, 0));
                points.add(new ProjectedPoint3D(3, -3, 0));
                points.add(new ProjectedPoint3D(3, 3, 0));
               
                for (int i = 0; i < (Integer)pointCount.getValue(); i++) {
                    points.add(new ProjectedPoint3D(rand.nextDouble()*6-3,
                            rand.nextDouble()*6-3, rand.nextDouble()*0.5-0.25));
                }
               
                // Triangulate (Delaunay)
                triangulation = Delaunay.randomizedIncremental(points);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.