Can i write the InfiniteOpt's Model to file of nl?
Dear InfiniteOpt team,
If there exists a model of like the following
# INITIALIZE THE MODEL
model = InfiniteModel(Ipopt.Optimizer)
And then can i write the model to File_name.nl with the command of
write_to_file(model,"model.nl")
Dose the alternative method of
using AmplNLWriter
model = InfiniteModel(()->AmplNLWriter.Optimizer("Your_path\ipopt.exe"))
works ?
Thanks for your time.
Describe the feature you'd like I need the feature that i can write the model builded by InfinityOpt.jl to file of File_Name.nl. Thanks.
Sincerely. Aijune WANG
See #231. You cannot directly write an InfiniteOpt model to an NL file, the issue is that the NL file format does not support infinite dimensional formulations.
However, you can write the discretized JuMP version to an NL writer:
model = InfiniteModel()
# define your model here
build_optimizer_model!(model)
write_to_file(optimizer_model(model), "model.nl")
Once version 0.6 is released, the above will become:
model = InfiniteModel()
# define your model here
build_transformation_backend!(model)
write_to_file(transformation_model(model), "model.nl")
Answering your other question, InfiniteOpt is compatible with any JuMP solver, this includes AmplNLWriter.
If you just want to interface with a solver executable, then I would most recommend using AmplNLWriter.
I am closing this in favor of #231.