emadehsan / csp

Algorithm for Cutting Stock Problem using Google OR-Tools. Link to the tool:
https://emadehsan.com/csp/
MIT License
129 stars 38 forks source link

Run multiple times the code with diferent input #16

Open TheDammedSon opened 1 year ago

TheDammedSon commented 1 year ago

Hello Emad

First of all, thank you for this code, it has been a great help in my work.

I was wondering how can I run the code several times with different input to get multiple results, when I close the plot I have to run the code again.

I've changed the code in order select a input file via "tkinter.filedialog" the missing part is to run the solver several times

Thank you

emadehsan commented 1 year ago

Hi @TheDammedSon ,

I guess what you want can be achieved with a simple approach of surrounding the main function in an infinite loop (while True:)? Probably add an input prompt that waits for user input before running next time?

TheDammedSon commented 1 year ago

Hi @emadehsan

A input prompt that waits for user input looks good, but some times the calculations take a bit longer.

I've used pyautogui and when I press a specific key it runs a next time.

The problem here is I don't know where I put the infinite loop, is the main function you mention the def main():?

Thank you