private void GeneratePoints()
        {
            RandomPointListGenerator random = new RandomPointListGenerator(10);

            random.CreateList(height, width, count);
            points = random.GetList();
        }
Пример #2
0
        public static List <Point> generatePoints(int width, int height, int AmountOfPoints)
        {
            IPointGenerator generator = new RandomPointListGenerator(11);

            generator.CreateList(10, 10, AmountOfPoints);
            List <Point> points = generator.GetList();

            return(points);
        }
        public void DistrubutionIsEqual()
        {
            IPointGenerator pointGenerator = new RandomPointListGenerator(10);
            int             count          = 10000;
            int             width          = 200;
            int             height         = 200;

            pointGenerator.CreateList(width, height, count);
            List <Point> output = pointGenerator.GetList();
            double       countXLargerThanHundred   = output.Count(c => c.X > 100);
            double       countYLargerThanHundred   = output.Count(c => c.Y > 100);
            double       percentXLargerThanHundret = countXLargerThanHundred / count;
            double       percentYLargerThanHundret = countYLargerThanHundred / count;

            Assert.AreEqual(0.5, percentXLargerThanHundret, 0.01);
            Assert.AreEqual(0.5, percentYLargerThanHundret, 0.01);
        }
 public void CreateInterfaceDerivative()
 {
     IPointGenerator randomgenerator   = new RandomPointListGenerator(10);
     IPointGenerator functiongenerator = new XSquaredPointListGenerator(10);
 }
Пример #5
0
 private void GenerateRandomPoints()
 {
     IPointGenerator pointGenerator = new RandomPointListGenerator(10);
     pointGenerator.CreateList(width, height, count);
     points = pointGenerator.GetList();
 }