Question: Fix this LINGO code so that it selects the players with the highest weights based on the salary and position constraints. The goal is to
Fix this LINGO code so that it selects the players with the highest weights based on the salary and position constraints. The goal is to have the program pick the players with the highest weights based in the given constraints and then multiply that be either or There should be only Centers with a selected value of the rest should be same for LW and RW only D with a selected value of and only goalies with a selected value of The solution report should keep the weights and caphit of each player the same as in the excel sheet and only the "selected" variable will change to either a or based on if the player was selected. Therefore only the players selected for the team will have a next to them in the solution report and everyone will have a
sets:
PlayerPP;
PositionCDLWRWG;
OnRosterPlayerPosition:weight,caphit,selected;
endsets
data:
weight @OLEC:UsersColeWOneDriveDesktopplayerstats Lingo.xlsxC:G;
caphit @OLEC:UsersColeWOneDriveDesktopplayerstats Lingo.xlsxH:L;
enddata
max maxweight;
maxweight @sumOnRosterij: weightijselectedij;
@forPlayeri: @sumPositionj: selectedij;
@sumOnRosterij: caphitijselectedij;
@sumOnRosterijj#EQ#: selectedij;
@sumOnRosterijj#EQ#: selectedij;
@sumOnRosterijj#EQ#: selectedij;
@sumOnRosterijj#EQ#: selectedij;
@sumOnRosterijj#EQ#: selectedij;
@forOnRosterij: @binselected;
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
