MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / individual_objectives

Function individual_objectives

examples/multi_objective.py:25–35  ·  view source on GitHub ↗
(h, X)

Source from the content-addressed store, hash-verified

23#
24# individual optimization of each objective
25def individual_objectives(h, X):
26 print('## Individual:\n')
27 objective_values = []
28
29 for k in range(OBJECTIVES):
30 h.maximize(np.dot(X, profit[k,:]))
31 print(f' Obj {k+1}: [{"".join(map(lambda x: "{:1.0f}".format(x), profit[k,:]))}]')
32 print(f' Sol {k+1}: [{"".join(map(lambda x: "{:1.0f}".format(x), abs(h.vals(X))))}]\n')
33 objective_values.append(h.getObjectiveValue())
34
35 print(f' OBJ: {pretty_print(objective_values)}\n\n')
36
37#
38# manual implementation of lexicographic multi-objective optimization

Callers 1

multi_objective.pyFile · 0.85

Calls 9

rangeFunction · 0.85
mapFunction · 0.85
pretty_printFunction · 0.85
maximizeMethod · 0.80
dotMethod · 0.80
joinMethod · 0.80
valsMethod · 0.80
appendMethod · 0.45
getObjectiveValueMethod · 0.45

Tested by

no test coverage detected