Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Dec 2, 2024
1 parent 621ff08 commit 712c007
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/problem/multiObjective/multiObjectiveKnapsack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ function multiObjectiveKnapsack(profits::Matrix{Int}, weights::Matrix{Int}, capa
for i in 1:size(profits, 1)
f = x -> begin
totalProfit = 0;
for bit in 1:numberOfBits
if x.bits[bit]
totalProfit += profits[i, bit]
for bitIndex in 1:numberOfBits
if x.bits[bitIndex]
totalProfit += profits[i, bitIndex]
end
end
return -totalProfit
Expand All @@ -35,9 +35,9 @@ function multiObjectiveKnapsack(profits::Matrix{Int}, weights::Matrix{Int}, capa
for i in 1:size(weights, 1)
c = x -> begin
totalWeight = 0;
for bit in 1:numberOfBits
if x.bits[bit]
totalWeight += weights[i, bit]
for bitIndex in 1:numberOfBits
if x.bits[bitIndex]
totalWeight += weights[i, bitIndex]
end
end
constraintValue = capacities[i] - totalWeight
Expand Down

0 comments on commit 712c007

Please sign in to comment.