# BoundsError when re-solving a model

**URL:** https://discourse.julialang.org/t/boundserror-when-re-solving-a-model/12050
**Category:** Optimization (Mathematical)
**Tags:** question
**Created:** [June 28, 2018, 11:37pm UTC](https://discourse.julialang.org/t/boundserror-when-re-solving-a-model/12050 "2018-06-28T23:37:12Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![varun7rs](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@varun7rs](https://discourse.julialang.org/u/varun7rs)
#### Post date: [June 29, 2018, 5:55pm UTC](https://discourse.julialang.org/t/boundserror-when-re-solving-a-model/12050/5 "2018-06-29T17:55:06Z")

</div>

Since I modify model `p` at every iteration(I add a cut-off constraint which is modified over the course of the heuristic), I wanted to have a different copy of the model. And since I had trouble doing [this](https://discourse.julialang.org/t/solving-a-model-and-its-modified-copy/9778), I used `deepcopy`. Is there another way around this problem?

For now, I’ve settled with re-building the problem at each iteration by calling `createproblem` but I’m worried if model building would consume a lot of time for larger problem instances

---

_[View the full topic](https://discourse.julialang.org/t/boundserror-when-re-solving-a-model/12050)._
