/// <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(); }
/// <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(); }
// 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); }
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(); }
// 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); }
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(); }
/// <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(); }
/// <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(); }
public Problem(int seed, int size, int timeInSeconds, HardMode.Modes mode) { initialize(seed, size, timeInSeconds, mode); }
/// <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(); }