MethodError: objects of type Module are not callable
Asked Answered
G

1

5

I am trying to duplicate a code in Julia using Jupyter Notebook.
and getting the error

MethodError: objects of type Module are not callable

What am i missing here?

using JuMP, Clp
m=Model(solver=Clp())
@variable(m, 0 >= x >= 9)
@variable(m, 0 >= y >= 10)

@objective(m,Min,3x-y)

@constraint(m,const1, 6x+5y <=30)
@constraint(m,const2, 7x+12y <= 84)
@constraint(m,const3, 19x+14y <=266)

solve(m)
println("Optimal Solutions:")
println("x = ", getvalue(x))
println("y = ", getvalue(y))
Gramme answered 12/6, 2017 at 4:9 Comment(0)
D
7

Clp is a module, you cannot call a module, ie. Cpl(), you want to call ClpSolver instead, see:

Use: m = Model(solver = ClpSolver())

Delorisdelorme answered 12/6, 2017 at 4:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.