Skip to content

Commit

Permalink
fixed stage 1 cost with help from Jesse
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandopalafox committed Jan 20, 2024
1 parent 34e2e09 commit 73f4e11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion experiments/tower_defense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ Compute objective at Stage 1
"""
function compute_J(r, x, pws, ws)
n = length(pws)
1/(1 - r' * pws) * sum([(1 - r[j]) * pws[j] * J_1(x[Block(1)], x[Block(j + n + 1)]) for j in 1:n])
sum([(1 - r[j]) * pws[j] * J_1(x[Block(1)], x[Block(j + n + 1)]) for j in 1:n]) +
sum([r[j] * pws[j] * J_1(x[Block(j + 1)], x[Block(j + 2 * n + 1)]) for j in 1:n])
end

"""
Expand Down

0 comments on commit 73f4e11

Please sign in to comment.