예제 #1
0
 /// <summary>
 /// make a new problem with the given size, now including timelimit paremeter that was added to form.
 /// </summary>
 /// <param name="size">number of cities</param>
 public void GenerateProblem(int size, HardMode.Modes mode, int timelimit)
 {
     this._size      = size;
     this._mode      = mode;
     this.time_limit = timelimit * 1000;                                   //convert seconds to milliseconds
     resetData();
 }
예제 #2
0
 /// <summary>
 ///     make a new problem with the given size, now including timelimit paremeter that was added to form.
 /// </summary>
 /// <param name="size">number of cities</param>
 public void GenerateProblem(int size, HardMode.Modes mode, int timelimit)
 {
     Size       = size;
     _mode      = mode;
     _timeLimit = timelimit * 1000; //convert seconds to milliseconds
     ResetData();
 }
예제 #3
0
        // not necessarily a new problem but resets the state using the specified settings
        private void reset()
        {
            this.SetSeed(); // also resets the CityData variable

            int size = getProblemSize();

            HardMode.Modes mode = getMode();

            CityData.GenerateProblem(size, mode);
        }
예제 #4
0
        private void reset(int seed, int problemSize, int timeLimit)
        {
            this.toolStrip1.Focus();  // Not sure why this is here; leftover from previous code
            HardMode.Modes mode = getMode();

            CityData = new Problem(seed, problemSize, timeLimit, mode);

            tbSeed.Text         = seed.ToString();
            tbProblemSize.Text  = problemSize.ToString();
            tbTimeLimit.Text    = timeLimit.ToString();
            tbCostOfTour.Text   = " --";
            tbElapsedTime.Text  = " --";
            tbNumSolutions.Text = " --";              // re-blanking the text boxes that may have been modified by a solver
            this.Invalidate();
        }
예제 #5
0
        // not necessarily a new problem but resets the state using the specified settings
        private void reset()
        {
            this.SetSeed(); // also resets the CityData variable

            int size      = getProblemSize();
            int timelimit = getTimeLimit();

            HardMode.Modes mode = getMode();

            tbCostOfTour.Text   = " --";
            tbElapsedTime.Text  = " --";
            tbNumSolutions.Text = " --";              // re-blanking the text boxes that may have been modified by a solver

            CityData.GenerateProblem(size, mode, timelimit);
        }
예제 #6
0
        private void initialize(int seed, int problemSize, int timeInSeconds, HardMode.Modes mode)
        {
            this.seed = seed;
            this.rnd  = new Random(seed);

            // CRITICAL - TO MAKE THE POINTS LOOK LIKE THE
            // POINTS IN THE OLD VERSION FOR THE SAME SEEDS
            // DO NOT REMOVE THIS FOR LOOP
            for (int i = 0; i < 50; i++)
            {
                rnd.NextDouble();
            }

            this.size      = problemSize;
            this.mode      = mode;
            this.timeLimit = timeInSeconds * 1000;                        // timer wants timeLimit in milliseconds
            this.resetData();
        }
예제 #7
0
 /// <summary>
 /// make a new problem with the given size.
 /// </summary>
 /// <param name="size">number of cities</param>
 public void GenerateProblem(int size, HardMode.Modes mode)
 {
     this._size = size;
     this._mode = mode;
     resetData();
 }
예제 #8
0
 /// <summary>
 /// make a new problem with the given size, now including timelimit paremeter that was added to form.
 /// </summary>
 /// <param name="size">number of cities</param>
 public void GenerateProblem(int size, HardMode.Modes mode, int timelimit)
 {
     this._size = size;
     this._mode = mode;
     this.time_limit = timelimit*1000;                                   //convert seconds to milliseconds
     resetData();
 }
예제 #9
0
 /// <summary>
 /// make a new problem with the given size.
 /// </summary>
 /// <param name="size">number of cities</param>
 public void GenerateProblem(int size, HardMode.Modes mode)
 {
     this._size = size;
     this._mode = mode;
     resetData();
 }
예제 #10
0
 public Problem(int seed, int size, int timeInSeconds, HardMode.Modes mode)
 {
     initialize(seed, size, timeInSeconds, mode);
 }
예제 #11
0
 /// <summary>
 ///     make a new problem with the given size.
 /// </summary>
 /// <param name="size">number of cities</param>
 public void GenerateProblem(int size, HardMode.Modes mode)
 {
     Size  = size;
     _mode = mode;
     ResetData();
 }