Skip to content

Commit

Permalink
re-added sigmoid
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandopalafox committed Feb 23, 2024
1 parent 47ff860 commit d085257
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion experiments/tower_defense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,14 @@ Attacker cost function
β: vector containing P2's (attacker) preference parameters for each world.
"""
function J_2(u, v, β)
-sum([β[ii]^(v[ii] - u[ii]) for ii in eachindex(β)])
# -sum([β[ii]^(v[ii] - u[ii]) for ii in eachindex(β)])
δ = [β[ii]*v[ii] - u[ii] for ii in eachindex(β)]
-sum([activate(δ[j])*(β[j]*v[j]-u[j])^2 for j in eachindex(β)])

end

function activate(δ; k=10.0)
return 1/(1 + exp(-2 * δ * k))
end

"""
Expand Down

0 comments on commit d085257

Please sign in to comment.