-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
termination - TB #169
Comments
As I understand it, TB is limiting the duration of “solve” as a whole. |
In short, if I need it to run for a maximum of 60s, what should I do |
I don't really know what is wrong with your environment. But the logic in the code is not wrong. My environment is running okay. |
import time As a matter of fact, I also looked at your source code environment: win10 |
I think in previous version 3.0.0 has the problem with time bound that someone has raised the issued. So you should use the latest version 3.0.1 to avoid this bug.
|
term_dict = {
"max_epoch": 15,
"max_time": 60,
"max_fe": 1000,
}
model.solve(xxxxxxxxxxxxx,,termination=term_dict)
2024/10/08 04:34:00 PM, INFO, mealpy.swarm_based.PSO.P_PSO [line: 162]: Solving single objective optimization problem.
2024/10/08 04:34:13 PM, INFO, mealpy.swarm_based.PSO.P_PSO [line: 270]: >>>Problem: P, Epoch: 1, Current best: 0.052123457433011944, Global best: 0.052123457433011944, Runtime: 6.29122 seconds
2024/10/08 04:34:13 PM, WARNING, mealpy.swarm_based.PSO.P_PSO [line: 199]: Stopping criterion with maximum running time/time bound (TB) (seconds) occurred. End program!
As shown above, when “max_time”: 60, according to ’https://mealpy.readthedocs.io/en/latest/pages/general/advance_guide.html#stopping-condition-termination‘, the program should stop at 600s (or epoch=15). program should stop at 60s (or epoch=15). But in fact, it only runs for 6.92s, and the stop condition output stops because of 'TB'. To add to this, the same result is achieved with “max_time”: 600.
I'm wondering if it's a usage error or if you have an error in this area.
Translated with DeepL.com (free version)
The text was updated successfully, but these errors were encountered: