Skip to content

Commit e922b8d

Browse files
feat: scale hg weights from 1 to 100
1 parent 66b1788 commit e922b8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/specs/cnf/SpecManagerCnf.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ class SpecManagerCnf : public SpecManager {
213213
}
214214

215215
inline int hg_heuristic_scaled(Var v, int max) {
216-
int value = hg_heuristic(v);
217-
int ret = max / 100 - value;
216+
auto value = static_cast<double>(hg_heuristic(v));
217+
auto max_double = static_cast<double>(max);
218+
auto ret = 100 - static_cast<int>((value / max_double) * 100);
218219

219220
if (ret < 1) {
220221
ret = 1;

0 commit comments

Comments
 (0)