Copying a Model?

Hi, I was wondering if there has been progress on the front of being able to copy/deepcopy a model in JuMP?
Currently what I do is re-encode everything into the model but the encoding process is rather long and I would prefer to just copy the model.
I know that previously this didn’t work / wasn’t supported / created errors and so I am looking for a status update.

https://jump.dev/JuMP.jl/stable/reference/models/#JuMP.copy_model

Although I will ask: why do you want to copy a model? Most times, you are better off modifying it in-place.

Oh excellent thanks! I presume it’s working then. (Because I know in the past it was technically present but did not do what was intended).
I am copying a model / constructing a new one because I am doing parallel processing – trying to solve a whole bunch of similar MILPs all at the same time. Same base model with a few different constraints.

The link you provided doesn’t work anymore:

# 404

**File not found**

The site configured at this address does not contain the requested file.

If this is your site, make sure that the filename case matches the URL as well as any file permissions.
For root URLs (like `http://example.com/`) you must provide an `index.html` file.

[Read the full documentation](https://help.github.com/pages/) for more information about using **GitHub Pages**.

Is there a webpage for current JuMP version on how to copy a model? I am aware that I could modify the model but I need two different JuMP models that only differ on a few constraints.

2 Likes