This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine-generated - editing it directly is not advised | |
[[AbstractTrees]] | |
git-tree-sha1 = "03e0550477d86222521d254b741d470ba17ea0b5" | |
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | |
version = "0.3.4" | |
[[Adapt]] | |
deps = ["LinearAlgebra"] | |
git-tree-sha1 = "af92965fb30777147966f58acb05da51c5616b5f" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP, Ipopt | |
function minimize( | |
f::Function, | |
A::Matrix, | |
b::Vector, | |
optimizer::JuMP.OptimizerFactory | |
) | |
M, N = size(A) | |
@assert length(b) == M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Academic license - for non-commercial use only | |
Gurobi Optimizer version 7.5.2 build v7.5.2rc1 (mac64) | |
Copyright (c) 2017, Gurobi Optimization, Inc. | |
Read MPS format model from file server_file.mps | |
Reading time = 0.00 seconds | |
mdpDEFthreshold: 507 rows, 165 columns, 3561 nonzeros | |
Optimize a model with 507 rows, 165 columns and 3561 nonzeros | |
Variable types: 121 continuous, 44 integer (44 binary) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Calculus, MathOptInterface | |
const MOI = MathOptInterface | |
# ============================================================================== | |
# | |
# First we construct a simple subtype of MOI.AbstractNLPEvaluator. We use it | |
# to provide thin overloads for all the MOI NLP functions. | |
# | |
# ============================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Gurobi | |
model = Gurobi.Model(Gurobi.Env(), "model") | |
Gurobi.add_cvar!(model, 0.0, 0.0, 100.0) | |
Gurobi.add_cvar!(model, 0.0, 0.0, 100.0) | |
Gurobi.update_model!(model) | |
Gurobi.add_constr!(model, [1, 2], [1.0, 2.0], '=', 2.0) | |
Gurobi.update_model!(model) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@everywhere begin | |
using SDDP, JuMP, SDDiP, Gurobi | |
srand(myid() * 111111) | |
const NUMBER_OF_DAYS = 3 # Number of days | |
const NUMBER_OF_ROOMS = 2 # Number of rooms (room 1 cost 1 dollar, room 2 cost 2 dollar etc.) | |
const NUMBER_OF_REQUESTS = 5 # Number of requests (i.e. stages) | |
# revenue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkTools | |
struct VarRef | |
x::UInt64 | |
end | |
function f(A, B) | |
s = 0 | |
for y in Y | |
s += X[y] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\odow003>julia | |
_ | |
_ _ _(_)_ | A fresh approach to technical computing | |
(_) | (_) (_) | Documentation: http://docs.julialang.org | |
_ _ _| |_ __ _ | Type "?help" for help. | |
| | | | | | |/ _` | | | |
| | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) | |
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release | |
|__/ | x86_64-w64-mingw32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP, Clp | |
n = 4 | |
m = 3 | |
# Investment cost | |
ic = [16, 5, 32, 2] | |
# Fuel cost | |
C = [25, 80, 6.5, 160] | |
# Duration | |
T = [8760, 7000, 1500] / 8760 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First comment out lines https://github.com/JuliaOpt/Gurobi.jl/blob/master/src/GurobiSolverInterface.jl#L246-L254 | |
using Gurobi,JuMP | |
# Create the JuMP Model: | |
# min 0 | |
# s.t. | |
# x >= 1 | |
# x <= 3 | |
m=Model(solver=GurobiSolver()) | |
@variable(m, x) |
NewerOlder