Here is my MWE of the problem:

```
using JuMP
using Clp
Random.seed!(2017)
xlocs, ylocs = rand(5), rand(5)
function demo_problem(x,y)
counter = 0
for (xx,yy) in zip(x,y)
val = xx - yy
if (val > epsillon)
counter += 1
else
counter += -1
end
end
return counter
end
mm = Model(solver=ClpSolver())
@variable(mm, 0.0 <= x[1:5] <= 1.0)
@variable(mm, 0.0 <= y[1:5] <= 1.0)
@objective(mm, Min, demo_problem(x,y))
MethodError: no method matching isless(::Float64, ::JuMP.GenericAffExpr{Float64,Variable})
Closest candidates are:
isless(::Float64, !Matched::Float64) at float.jl:459
isless(!Matched::Missing, ::Any) at missing.jl:66
isless(::AbstractFloat, !Matched::AbstractFloat) at operators.jl:148
...
Stacktrace:
[1] <(::Float64, ::JuMP.GenericAffExpr{Float64,Variable}) at .\operators.jl:260
[2] >(::JuMP.GenericAffExpr{Float64,Variable}, ::Float64) at .\operators.jl:286
[3] demo_problem(::Array{Variable,1}, ::Array{Variable,1}) at .\In[25]:12
[4] top-level scope at C:\Users\tfr004\.julia\packages\JuMP\Xvn0n\src\macros.jl:859
[5] top-level scope at In[25]:25
```

In my actual problem, Iâ€™m counting line section intersections with this algorithm: https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ and my idea was to minize the intersections by using JuMP. I am open to any proposals, because the optimization is not my strongest competence.