Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Warn when Dimension is Modified on NZF1 & spmsrtls #354

Open
danphenderson opened this issue Dec 18, 2024 · 3 comments
Open

Fix: Warn when Dimension is Modified on NZF1 & spmsrtls #354

danphenderson opened this issue Dec 18, 2024 · 3 comments

Comments

@danphenderson
Copy link
Contributor

Warn on invalid dimension for NZF1: ref #123

  • When a user specifies n < 26 they should receive a warning that the dimension is being adjusted. (As done with the dixmaan* problems)

Figure out what is going on with spmsrtls: It appears to only like dimension's greater than 100.. but the specified dimension is being modified slightly; users should be warned.

@danphenderson danphenderson changed the title Fix: Warn when Dimension is Modified Fix: Warn when Dimension is Modified on NZF1 & spmsrtls Dec 18, 2024
@danphenderson
Copy link
Contributor Author

Also, investigate bearing; it doesn't like n=5 but provides no warning.

@tmigot
Copy link
Member

tmigot commented Dec 18, 2024

Thanks @danphenderson for the issue. It is true the package is not consistent in how the warning is handled.
It would be great to also have a simple way to deactivate the warning at the package level.

@tmigot
Copy link
Member

tmigot commented Dec 29, 2024

Moving forward with this, I did the following experiment:

using OptimizationProblems, Random

Random.seed!(1234)
n_lim = 200

names_pb_vars = OptimizationProblems.meta[
    OptimizationProblems.meta.variable_nvar .== true,
    [:name]
]
list_of_changing_variables = String[]
for prob in eachrow(names_pb_vars)
    for i=1:n_lim
        n_calc = OptimizationProblems.eval(Symbol(:get_, prob[:name], :_nvar))(n = i)
        if n_calc != i
            push!(list_of_changing_variables, prob[:name])
            break
        end
    end
end

#=
julia> print(list_of_changing_variables)
["NZF1", "bearing", "broydn7d", "catenary", "chain", "chainwoo", "channel", "clnlbeam", "clplatea", "clplateb", "clplatec", "controlinvestment", "dixmaane", "dixmaanf", "dixmaang", "dixmaanh", "dixmaani", "dixmaanj", "dixmaank", "dixmaanl", "dixmaanm", "dixmaann", "dixmaano", "dixmaanp", "elec", "hovercraft1d", "marine", "polygon", "polygon1", "polygon2", "polygon3", "powellsg", "robotarm", "spmsrtls", "structural", "woods"]
=#

so we should investigate these problems. As pointed out some already show warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants