From 73f4e11eed649c15f81d47fd54c437d442bcc22d Mon Sep 17 00:00:00 2001 From: fernandopalafox Date: Sat, 20 Jan 2024 08:58:57 -0600 Subject: [PATCH] fixed stage 1 cost with help from Jesse --- experiments/tower_defense.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experiments/tower_defense.jl b/experiments/tower_defense.jl index 2e4ef5a..ed93c7c 100644 --- a/experiments/tower_defense.jl +++ b/experiments/tower_defense.jl @@ -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 """