コード例 #1
0
        private void DrawStats(Graphics g, TSPStats stats)
        {
            TSPTour Tour = (TSPTour)stats.solution;
            string  text = "";

            text += String.Format("Score: {0}\n", Tour.Score());
            text += String.Format("Iterations: {0}\n", stats.iterations);
            text += String.Format("Cities: {0}\n", Tour.GetCities().Length);
            if (stats.working)
            {
                text += String.Format("Heat: {0}\n", stats.heat);
                text += "Searching...";
            }
            RectangleF pos = new RectangleF(2, 2, this.bitmap.Width - 2, this.bitmap.Height - 2);

            g.DrawString(text, TEXT_FONT, TEXT_BRUSH, pos);
        }