{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/806","repository_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl","labels_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/806/labels{/name}","comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/806/comments","events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/806/events","html_url":"https://github.com/JuliaOpt/JuMP.jl/issues/806","id":165430925,"number":806,"title":"MethodError: `getindex` has no method matching getindex(::Function, ::Int64)","user":{"login":"leoplct","id":1176145,"avatar_url":"https://avatars.githubusercontent.com/u/1176145?v=3","gravatar_id":"","url":"https://api.github.com/users/leoplct","html_url":"https://github.com/leoplct","followers_url":"https://api.github.com/users/leoplct/followers","following_url":"https://api.github.com/users/leoplct/following{/other_user}","gists_url":"https://api.github.com/users/leoplct/gists{/gist_id}","starred_url":"https://api.github.com/users/leoplct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoplct/subscriptions","organizations_url":"https://api.github.com/users/leoplct/orgs","repos_url":"https://api.github.com/users/leoplct/repos","events_url":"https://api.github.com/users/leoplct/events{/privacy}","received_events_url":"https://api.github.com/users/leoplct/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-13T21:56:35Z","updated_at":"2016-07-13T22:07:50Z","closed_at":null,"body":"I can't access to the first and second objective of functs_MOP4.\r\nSorry if I open an issues but I didn't find any examples.\r\n\r\n```\r\nusing JuMP\r\nusing NLopt\r\n\r\nfunction functs_MOP4(x::Vector)\r\n    pi = 4.0*atan(1.0)\r\n    n  = length(x)\r\n    f  = zeros(2)\r\n    f[1] = 0.0\r\n    for i = 1:(n-1)\r\n        f[1] = f[1] + (-10.0*exp(-0.20*sqrt(x[i]^2+x[i+1]^2)))\r\n    end\r\n    f[2] = 0.0\r\n    for i = 1:n\r\n        f[2] = f[2] + (abs(x[i])^0.8+5.0*sin(x[i]^3))\r\n    end\r\n\r\n    return f\r\nend\r\n\r\nfunction bounds_MOP4()\r\n    return ([-5.0;-5.0;-5.0],[5.0;5.0;5.0])\r\nend\r\n\r\nm = Model(solver=NLoptSolver(algorithm=:LD_MMA))\r\n@variable(m, x[1:2])\r\n@NLexpression(m, F1, functs_MOP4[1]) #<-- Problem Here\r\n@NLexpression(m, F2, functs_MOP4[2]) #<--- Problem here\r\nsolve(m)\r\n\r\nx1_id = getvalue(x)\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/comments/232501417","html_url":"https://github.com/JuliaOpt/JuMP.jl/issues/806#issuecomment-232501417","issue_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/806","id":232501417,"user":{"login":"joehuchette","id":1373010,"avatar_url":"https://avatars.githubusercontent.com/u/1373010?v=3","gravatar_id":"","url":"https://api.github.com/users/joehuchette","html_url":"https://github.com/joehuchette","followers_url":"https://api.github.com/users/joehuchette/followers","following_url":"https://api.github.com/users/joehuchette/following{/other_user}","gists_url":"https://api.github.com/users/joehuchette/gists{/gist_id}","starred_url":"https://api.github.com/users/joehuchette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehuchette/subscriptions","organizations_url":"https://api.github.com/users/joehuchette/orgs","repos_url":"https://api.github.com/users/joehuchette/repos","events_url":"https://api.github.com/users/joehuchette/events{/privacy}","received_events_url":"https://api.github.com/users/joehuchette/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T22:07:50Z","updated_at":"2016-07-13T22:07:50Z","body":"It should be ``@NLexpression(m, F1, functs_MOP4(1))`` (with parentheses). You're trying to index into a function, rather than call it."}}
{"actor":{"display_login":"joehuchette"}}