Skip to content
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

the up bounds do not work correctly #37

Closed
MontyKL opened this issue Feb 12, 2020 · 5 comments
Closed

the up bounds do not work correctly #37

MontyKL opened this issue Feb 12, 2020 · 5 comments
Labels

Comments

@MontyKL
Copy link

MontyKL commented Feb 12, 2020

when the precision is one, ie. the int_mode is true, the optimized result will lager than the up bounds.

@MontyKL
Copy link
Author

MontyKL commented Feb 12, 2020

at GA.py line 154, when you the constriant, the attribute of has constriant should be set to TRUE, self.has_constriant = True

@guofei9987
Copy link
Owner

Thank you!
You are right, it is a bug. I have fixed it.

  • if precision is integer:
  • if Lind_raw is integer, which means the number of all possible value is $2^n$, no need to modify
  • if Lind_raw is decimal, modify: make the ub bigger and add a constraint_ueq

The fixed version of scikit-opt will be released next version, and I‘d like to list you as contributor if you permit.

@guofei9987
Copy link
Owner

Thanks again! And I find more bugs in int_mode recently.
Besides, using penalty function to deal with upper bounds is a bad idea. It causes a lot of misusage and misunderstandings.
I have rebuilt the algorithm by another way in version 0.5.7.

@Jackwangnao
Copy link

郭老师您好!还想接着问一个整数模式的问题:
int_mode为True是指整数规划模式开启对吧?所以源码中self.int_mode_ = (self.precision % 1 == 0) & (Lind_raw % 1 != 0)这里的 Lind_raw 应该判断为 Lind_raw % 1 == 0 吧?

@guofei9987
Copy link
Owner

郭老师您好!还想接着问一个整数模式的问题:
int_mode为True是指整数规划模式开启对吧?所以源码中self.int_mode_ = (self.precision % 1 == 0) & (Lind_raw % 1 != 0)这里的 Lind_raw 应该判断为 Lind_raw % 1 == 0 吧?

这里代码可能有些歧义,这里的“整数规划模式”指的是需要特别处理才是整数的。如果问题本身不经过特别处理已经是实质上的整数规划,就没必要开启整数规划模式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants