# How to get a Models optimiser factory

**URL:** <https://discourse.julialang.org/t/how-to-get-a-models-optimiser-factory/94618>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [February 14, 2023, 10:40am UTC](https://discourse.julialang.org/t/how-to-get-a-models-optimiser-factory/94618 "2023-02-14T10:40:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [February 14, 2023, 10:40am UTC](https://discourse.julialang.org/t/how-to-get-a-models-optimiser-factory/94618/1 "2023-02-14T10:40:05Z")

</div>

How can I get a models optimiser factory? I’d like to be able to do:

```julia
using JuMP, HiGHS
m1 = Model(HiGHS.Optimizer)
m2 = Model(optimizer_factory(m1))

```

Although I’m not sure if I’m coming at this the wrong way. [Here](https://github.com/infrasenselabs/RoundAndSwap.jl/blob/d3c6717b3498f0b2df17b8e3e7ae70a9950a65de/src/model.jl#L141) I’d like to make multiple new copies of a model with the same optimiser for parallelisation purposes (I appreciate for now only one copy is made so it is redundant).

---

<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:** [February 14, 2023, 7:52pm UTC](https://discourse.julialang.org/t/how-to-get-a-models-optimiser-factory/94618/2 "2023-02-14T19:52:44Z")

</div>

> How can I get a models optimiser factory?

You can’t. Restructure your code so that you pass around the factory, rather than passing around the model.
