I try to run the following code block:
using JuMP
using CPLEX
function solveRMP(cust::Int64,
routes::Array{Float64,2},
routeCost::Array{Float64,1},
m::Int64)
cust_dep = cust+2;
rmp = Model(solver = CplexSolver())
# Add decistion variables
@variable(rmp, 0<=x[1:size(routes,2)])
#
# Add objective
@objective(rmp, Min, sum(routeCost[r]*x[r] for r=1:size(routes,2)))
# #####################
# ### Constraints
@constraint(rmp, cVisitCust[i=2:cust_dep-1], sum(routes[i,r]*x[r] for r=1:size(routes,2)) == 1)
@constraint(rmp, cMaxNrRoutes, sum(x[r] for r=1:size(routes,2)) <= m )
allConstraints = vcat(cVisitCust,cMaxNrRoutes)
writeLP(rmp, "myRMP.lp", genericnames=false);
solve(rmp)
duals = zeros(1,1)
append!(duals,getdual(allConstraints))
return getvalue(x), duals
end
and I get the following error:
**LoadError: MethodError: no method matching getname(::Int64)
Closest candidates are:
getname(!Matched::Expr) at
(...) **
mwithFloat64(m). The solver uses continuous values and integers confuse it. - Dan Getzwhile loading ...\VRTW.jl, in expression starting on line 28 include_string(::String, ::String) at loading.jl:515 include_string(::Module, ::String, ::String) at Compat.jl:577 (::Atom.##55#58{String,String})() at eval.jl:73 withpath(::Atom.##55#58{String,String}, ::String) at utils.jl:30 withpath(::Function, ::String) at eval.jl:38 macro expansion at eval.jl:71 [inlined] (::Atom.##54#57{Dict{String,Any}})() at task.jl:80- Berni