Skip to content

Commit

Permalink
eliminated importall JuMP
Browse files Browse the repository at this point in the history
  • Loading branch information
huckl3b3rry87 committed Jun 27, 2017
1 parent 4db46d5 commit 28758bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/NLOptControl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ isdefined(Base, :__precompile__) && __precompile__()

module NLOptControl

using JuMP
#import JuMP: @NLexpression, @NLobjective, @NLparameter, @NLconstraint, @constraint, @variable, setvalue, Model, setupperbound, setlowerbound
using Ipopt # temp fix for 0.6
using FastGaussQuadrature
importall JuMP
using DataFrames
using Ranges

include("Base.jl")
using .Base

Expand Down
5 changes: 3 additions & 2 deletions src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ function defineSolver!(n::NLOpt;kwargs...)
else
error("the :name key needs to be set to either :KNITRO or :Ipopt in defineSolver!()\n ")
end
n.mdl=JuMP.Model(solver=NLPsolver)
#n.mdl=JuMP.Model(solver=NLPsolver)
n.mdl=Model(solver=NLPsolver)

# optimal control problem
OCPdef!(n);
Expand Down Expand Up @@ -185,7 +186,7 @@ function OCPdef!(n::NLOpt)

# boundary constraints
n.r.xf_con=[]; # currently modifying the final state constraint (with tolerance) is not needed, can easily ad this functionlity though
@show if any(.!isnan.(n.X0_tol)) # create handles for constraining the entire initial state
if any(.!isnan.(n.X0_tol)) # create handles for constraining the entire initial state
n.r.x0_con=Array{Any}(n.numStates,2); # this is so they can be easily reference when doing MPC
else
n.r.x0_con=[];
Expand Down
1 change: 1 addition & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Date Create: 1/2/2017, Last Modified: 6/16/2017 \n
--------------------------------------------------------------------------------------\n
"""
function integrate!(n::NLOpt,V::Array{JuMP.Variable,1}; C=1.0,D=zeros(n.numStatePoints,),kwargs...)

kw = Dict(kwargs);
if !haskey(kw,:integrand); integrand = :default;
else; integrand = get(kw,:integrand,0);
Expand Down

0 comments on commit 28758bd

Please sign in to comment.