public void Run(IProgress <BuddhabrotReportProgress> progress = null) { long previousTotalHits = 0; do { float cx = XMin + (float)Rand.NextDouble() * (XMax - XMin); float cy = YMin + (float)Rand.NextDouble() * (Ymax - YMin); var point = new BuddhabrotPoint(cx, cy, MaxIteration); Hits.Add(point); if ((TotalHits - previousTotalHits * 1d) / HitsMax > 1 / 100d) { previousTotalHits = TotalHits; if (progress != null) { //progress.Report(new BuddhabrotReportProgress(this)); } } }while (Hits.Count < HitsMax); Completed = true; if (progress != null) { // progress.Report(new BuddhabrotReportProgress(this, true)); } }
public void Run(IProgress<BuddhabrotReportProgress> progress = null) { long previousTotalHits = 0; do { float cx = XMin + (float)Rand.NextDouble() * (XMax - XMin); float cy = YMin + (float)Rand.NextDouble() * (Ymax - YMin); var point = new BuddhabrotPoint(cx, cy, MaxIteration); Hits.Add(point); if ((TotalHits - previousTotalHits * 1d) / HitsMax > 1 / 100d) { previousTotalHits = TotalHits; if (progress != null) { //progress.Report(new BuddhabrotReportProgress(this)); } } } while (Hits.Count < HitsMax); Completed = true; if (progress != null) { // progress.Report(new BuddhabrotReportProgress(this, true)); } }