% Problem parameters enum TOYS;@\Vlabel{line:back-knap-toys}@ array[TOYS] of int: toy_joy;@\Vlabel{line:back-knap-joy}@ array[TOYS] of int: toy_space;@\Vlabel{line:back-knap-space}@ int: space_left;@\Vlabel{line:back-knap-left}@ % Decision variables var set of TOYS: selection;@\Vlabel{line:back-knap-sel}@ var int: total_joy = sum(toy in selection)(toy_joy[toy]);@\Vlabel{line:back-knap-tj}@ % Constraints constraint sum(toy in selection)(toy_space[toy]) < space_left;@\Vlabel{line:back-knap-con}@ % Goal solve maximize total_joy;@\Vlabel{line:back-knap-obj}@