Skip to content

Commit

Permalink
Delete glpk and ipopt related files and made sure clp successfully ran
Browse files Browse the repository at this point in the history
  • Loading branch information
xuqingyu committed Jun 3, 2021
1 parent 4a3598f commit c5dcb47
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TimeLimit: 110000 # Solution timeout limit. For example, set_optimizer_att
#CBC-specific solver settings
logLevel: 1 # Set to 1 to enable solution output. For example, set_optimizer_attribute(model, "logLevel", 1).
maxSolutions: -1 # Terminate after this many feasible solutions have been found. For example, set_optimizer_attribute(model, "maxSolutions", 1).
maxNodes: 1 # Terminate after this many branch-and-bound nodes have been evaluated. For example, set_optimizer_attribute(model, "maxNodes", 1).
allowableGap: # Terminate after optimality gap is less than this value (on an absolute scale). For example, set_optimizer_attribute(model, "allowableGap", 0.05).
ratioGap: # Terminate after optimality gap is smaller than this relative fraction. For example, set_optimizer_attribute(model, "allowableGap", 0.05).
threads: # Set the number of threads to use for parallel branch & bound. For example, set_optimizer_attribute(model, "threads", 2)
maxNodes: -1 # Terminate after this many branch-and-bound nodes have been evaluated. For example, set_optimizer_attribute(model, "maxNodes", 1).
allowableGap: 5000 # Terminate after optimality gap is less than this value (on an absolute scale). For example, set_optimizer_attribute(model, "allowableGap", 0.05).
ratioGap: 0.01 # Terminate after optimality gap is smaller than this relative fraction. For example, set_optimizer_attribute(model, "allowableGap", 0.05).
threads: 2 # Set the number of threads to use for parallel branch & bound. For example, set_optimizer_attribute(model, "threads", 2)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CapacityReserveMargin: 1 # Number of capacity reserve margin constraints; 0 = no
CO2Cap: 1 # CO2 emissions cap; 0 = not active (no CO2 emission limit); 1 = mass-based emission limit constraint; 2 = load + rate-based emission limit constraint; 3 = generation + rate-based emission limit constraint
StorageLosses: 1 # Energy Share Requirement and CO2 constraints account for energy lost; 0 = not active (DO NOT account for energy lost); 1 = active systemwide (DO account for energy lost)
MinCapReq: 1 # Activate minimum technology carveout constraints; 0 = not active; 1 = active
Solver: Gurobi # Available solvers: Gurobi, CPLEX, CLPs
Solver: Clp # Available solvers: Gurobi, CPLEX, Clps
ParameterScale: 1 # Turn on parameter scaling wherein load, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
UCommit: 0 # Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering
Expand Down
Empty file.
Empty file.
2 changes: 0 additions & 2 deletions src/GenX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ include("configure_solver/configure_gurobi.jl")
include("configure_solver/configure_cplex.jl")
include("configure_solver/configure_clp.jl")
include("configure_solver/configure_cbc.jl")
include("configure_solver/configure_glpk.jl")
include("configure_solver/configure_ipopt.jl")
include("configure_solver/configure_solver.jl")

# Load input data
Expand Down
28 changes: 14 additions & 14 deletions src/configure_solver/configure_clp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ received this license file. If not, see <http://www.gnu.org/licenses/>.
@doc raw"""
configure_clp(solver_settings_path::String)
Reads user-specified solver settings from clp_settings.yml in the directory specified by the string solver_settings_path.
# Reads user-specified solver settings from clp_settings.yml in the directory specified by the string solver_settings_path.
Returns a MathOptInterface OptimizerWithAttributes Clp optimizer instance to be used in the GenX.generate_model() method.
# Returns a MathOptInterface OptimizerWithAttributes Clp optimizer instance to be used in the GenX.generate_model() method.
The Clp optimizer instance is configured with the following default parameters if a user-specified parameter for each respective field is not provided:
- PrimalTolerance = 1e-7 (Primal feasibility tolerance)
- DualTolerance = 1e-7 (Dual feasibility tolerance)
- DualObjectiveLimit = 1e308 (When using dual simplex (where the objective is monotonically changing), terminate when the objective exceeds this limit)
- MaximumIterations = 2147483647 (Terminate after performing this number of simplex iterations)
- MaximumSeconds = -1.0 (Terminate after this many seconds have passed. A negative value means no time limit)
- LogLevel = 1 (Set to 1, 2, 3, or 4 for increasing output. Set to 0 to disable output)
- PresolveType = 0 (Set to 1 to disable presolve)
- SolveType = 5 (Solution method: dual simplex (0), primal simplex (1), sprint (2), barrier with crossover (3), barrier without crossover (4), automatic (5))
- InfeasibleReturn = 0 (Set to 1 to return as soon as the problem is found to be infeasible (by default, an infeasibility proof is computed as well))
- Scaling = 3 (0 0ff, 1 equilibrium, 2 geometric, 3 auto, 4 dynamic (later))
- Perturbation = 100 (switch on perturbation (50), automatic (100), don't try perturbing (102))
# - PrimalTolerance = 1e-7 (Primal feasibility tolerance)
# - DualTolerance = 1e-7 (Dual feasibility tolerance)
# - DualObjectiveLimit = 1e308 (When using dual simplex (where the objective is monotonically changing), terminate when the objective exceeds this limit)
# - MaximumIterations = 2147483647 (Terminate after performing this number of simplex iterations)
# - MaximumSeconds = -1.0 (Terminate after this many seconds have passed. A negative value means no time limit)
# - LogLevel = 1 (Set to 1, 2, 3, or 4 for increasing output. Set to 0 to disable output)
# - PresolveType = 0 (Set to 1 to disable presolve)
# - SolveType = 5 (Solution method: dual simplex (0), primal simplex (1), sprint (2), barrier with crossover (3), barrier without crossover (4), automatic (5))
# - InfeasibleReturn = 0 (Set to 1 to return as soon as the problem is found to be infeasible (by default, an infeasibility proof is computed as well))
# - Scaling = 3 (0 0ff, 1 equilibrium, 2 geometric, 3 auto, 4 dynamic (later))
# - Perturbation = 100 (switch on perturbation (50), automatic (100), don't try perturbing (102))
"""
# """
function configure_clp(solver_settings_path::String)

solver_settings = YAML.load(open(solver_settings_path))
Expand Down
70 changes: 0 additions & 70 deletions src/configure_solver/configure_glpk.jl

This file was deleted.

70 changes: 0 additions & 70 deletions src/configure_solver/configure_ipopt.jl

This file was deleted.

6 changes: 0 additions & 6 deletions src/configure_solver/configure_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ function configure_solver(solver::String, solver_settings_path::String)
elseif solver == "Cbc"
cbc_settings_path = joinpath(solver_settings_path, "cbc_settings.yml")
OPTIMIZER = configure_cbc(cbc_settings_path)
#=elseif solver == "GLPK"
glpk_settings_path = joinpath(solver_settings_path, "glpk_settings.yml")
OPTIMIZER = configure_glpk(glpk_settings_path)
elseif solver == "Ipopt"
ipopt_settings_path = joinpath(solver_settings_path, "ipopt_settings.yml")
OPTIMIZER = configure_ipopt(ipopt_settings_path)=#
end

return OPTIMIZER
Expand Down
2 changes: 2 additions & 0 deletions src/write_outputs/write_status.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ function write_status(path::AbstractString, sep::AbstractString, inputs::Dict, s
if (setup["UCommit"] == 0 || setup["UCommit"] == 2)
dfStatus = DataFrame(Status = status, Solve = inputs["solve_time"],
Objval = objective_value(EP))
else
dfStatus = DataFrame(Status = status, Solve = inputs["solve_time"],
Objval = objective_value(EP), Objbound= objective_bound(EP),FinalMIPGap =(objective_value(EP) -objective_bound(EP))/objective_value(EP) )
end

CSV.write(string(path,sep,"status.csv"),dfStatus)
end

0 comments on commit c5dcb47

Please sign in to comment.