(h, X)
| 87 | # |
| 88 | # manual implementation of weighted multi-objective optimization |
| 89 | def manual_weighted(h, X): |
| 90 | print('## Manual Weighted:\n') |
| 91 | weights = np.asarray([1.0/(k+1) for k in range(OBJECTIVES)], dtype=np.float64) |
| 92 | h.maximize(np.dot(weights[:,None] * profit, X).sum()) |
| 93 | |
| 94 | print(f' SOL: [{"".join(map(lambda x: "{:1.0f}".format(x), abs(h.vals(X))))}]') |
| 95 | print(f' OBJ: {pretty_print(np.dot(profit, h.vals(X)))}\n') |
| 96 | |
| 97 | print(f' Obj: {h.getObjective()[0]}\n\n') |
| 98 | |
| 99 | |
| 100 | # |
no test coverage detected