public DNAPoint() { calculated = false; x = gen.GetRandom(); y = gen.GetRandom(); }
public DNABrush() { calculated = false; a = gen.GetRandom(set.minValueAlpha, set.maxValueAlpha + 1); r = gen.GetRandom(set.minValueRed, set.maxValueRed + 1); g = gen.GetRandom(set.minValueGreen, set.maxValueGreen + 1); b = gen.GetRandom(set.minValueBlue, set.maxValueBlue + 1); }
public DNAPicture(DNAPicture mother, DNAPicture father) { calculated = false; fitness = 0; polygons = new List <DNAPolygon>(); int i = mother.polygons.Count - 1; int j = father.polygons.Count - 1; while (i >= 0 || j >= 0) { if (i >= 0 && j >= 0) { if (gen.GetRandom() < 0.5) { polygons.Add(mother.polygons[i]); } else { polygons.Add(father.polygons[j]); } } else if (i >= 0) { polygons.Add(mother.polygons[i]); } else { polygons.Add(father.polygons[j]); } --i; --j; } polygons.Reverse(); }
public DNAPolygon() { brush = new DNABrush(); points = new List <DNAPoint>(); calculated = false; double x = gen.GetRandom(); double y = gen.GetRandom(); for (int i = 0; i < set.pointCountMin; ++i) { DNAPoint point = new DNAPoint(); point.x = Math.Max(0, Math.Min(1, x + 2 * (gen.GetRandom() - 0.5) * set.polygonInitialScale)); point.y = Math.Max(0, Math.Min(1, y + 2 * (gen.GetRandom() - 0.5) * set.polygonInitialScale)); points.Add(point); } }