# Defining parameters in CPLEX

**URL:** https://discourse.julialang.org/t/defining-parameters-in-cplex/34476
**Category:** Optimization (Mathematical)
**Created:** [February 11, 2020, 5:58pm UTC](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476 "2020-02-11T17:58:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [February 11, 2020, 5:58pm UTC](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476/1 "2020-02-11T17:58:44Z")

</div>

Hello dears users,  
I want to define the limit of CPU time, gap etc for CPLEX in a given integer problem. In JuMP version v0.19 I was used to define:

```julia
model=Model(with_optimizer(CPLEX.Optimizer,CPX_PARAM_TILIM=10800,CPX_PARAM_SCRIND=0,
CPX_PARAM_EPGAP=0.001))

```

In the new version, this command does not work.  
Anyone could help me plese?  
How can I define the same parameters before the optmization?  
Many thanks

---

<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 11, 2020, 5:59pm UTC](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476/2 "2020-02-11T17:59:51Z")

</div>

```nohighlight
model = Model(with_optimizer(CPLEX.Optimizer))
set_parameters(model, "CPX_PARAM_TILIM" => 10_800, "CPX_PARAM_SCRIND" => 0)

```

---

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [February 11, 2020, 6:12pm UTC](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476/3 "2020-02-11T18:12:52Z")

</div>

> [@odow](#):
>
> model = Model(with\_optimizer(CPLEX.Optimizer)) set\_parameters(model, “CPX\_PARAM\_TILIM” =\> 10\_800, “CPX\_PARAM\_SCRIND” =\> 0)

I have the following error message:

```julia
UndefVarError: set_parameters not defined
top-level scope at none:0

```

The version of my Packages are:  
[c52e3926] Atom v0.11.3  
[a076750e] CPLEX v0.6.3  
[5789e2e9] FileIO v1.2.2  
[7073ff75] IJulia v1.21.1  
[b6b21f68] Ipopt v0.6.1  
[033835bb] JLD2 v0.1.11  
[4076af6c] JuMP v0.20.1  
[2ddba703] Juniper v0.5.3  
[e5e0dc1b] Juno v0.7.2  
[91a5bcdd] Plots v0.29.1  
[37e2e46d] LinearAlgebra  
[de0858da] Printf  
[9e88b42a] Serialization  
[10745b16] Statistics

---

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [February 11, 2020, 6:51pm UTC](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476/4 "2020-02-11T18:51:42Z")

</div>

The correct is:  
model = Model(with\_optimizer(CPLEX.Optimizer)) set\_parameters(model, “CPX\_PARAM\_TILIM” , 10\_800, “CPX\_PARAM\_SCRIND” , 0)
