# Looped optimization model

**URL:** <https://discourse.julialang.org/t/looped-optimization-model/26600>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [July 21, 2019, 7:04am UTC](https://discourse.julialang.org/t/looped-optimization-model/26600 "2019-07-21T07:04:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 21, 2019, 4:38pm UTC](https://discourse.julialang.org/t/looped-optimization-model/26600/2 "2019-07-21T16:38:01Z")

</div>

Please read [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) and provide a minimal working example.

If the loop works for you, that’s probably best. If you haven’t already, I would wrap the inner part of the loop in a function so that it looks like this:

```nohighlight
function build_and_solve_model(filename)
    # ...
end
for file_name in ["a.csv", "b.csv"]
    build_and_solve_model(file_name)
end

```

---

_[View the full topic](https://discourse.julialang.org/t/looped-optimization-model/26600)._
