config: separate solver_options
solve_network: adjust code to new solver_options config
This commit is contained in:
parent
b2295278f3
commit
3bbd321b82
@ -281,33 +281,86 @@ clustering:
|
|||||||
efficiency: mean
|
efficiency: mean
|
||||||
|
|
||||||
solving:
|
solving:
|
||||||
|
#tmpdir: "path/to/tmp"
|
||||||
options:
|
options:
|
||||||
formulation: kirchhoff
|
formulation: kirchhoff
|
||||||
|
clip_p_max_pu: 1.e-2
|
||||||
load_shedding: false
|
load_shedding: false
|
||||||
noisy_costs: true
|
noisy_costs: true
|
||||||
min_iterations: 4
|
|
||||||
max_iterations: 6
|
|
||||||
clip_p_max_pu: 0.01
|
|
||||||
skip_iterations: true
|
skip_iterations: true
|
||||||
track_iterations: false
|
track_iterations: false
|
||||||
#nhours: 10
|
min_iterations: 4
|
||||||
|
max_iterations: 6
|
||||||
|
keep_shadowprices:
|
||||||
|
- Bus
|
||||||
|
- Line
|
||||||
|
- Link
|
||||||
|
- Transformer
|
||||||
|
- GlobalConstraint
|
||||||
|
- Generator
|
||||||
|
- Store
|
||||||
|
- StorageUnit
|
||||||
|
|
||||||
solver:
|
solver:
|
||||||
name: gurobi
|
name: gurobi
|
||||||
threads: 4
|
options: gurobi-default
|
||||||
method: 2 # barrier
|
|
||||||
crossover: 0
|
solver_options:
|
||||||
BarConvTol: 1.e-5
|
highs-default:
|
||||||
FeasibilityTol: 1.e-6
|
# refer to https://ergo-code.github.io/HiGHS/options/definitions.html#solver
|
||||||
AggFill: 0
|
threads: 4
|
||||||
PreDual: 0
|
solver: "ipm"
|
||||||
GURO_PAR_BARDENSETHRESH: 200
|
run_crossover: "off"
|
||||||
# solver:
|
small_matrix_value: 1e-6
|
||||||
# name: cplex
|
large_matrix_value: 1e9
|
||||||
# threads: 4
|
primal_feasibility_tolerance: 1e-5
|
||||||
# lpmethod: 4 # barrier
|
dual_feasibility_tolerance: 1e-5
|
||||||
# solutiontype: 2 # non basic solution, ie no crossover
|
ipm_optimality_tolerance: 1e-4
|
||||||
# barrier.convergetol: 1.e-5
|
parallel: "on"
|
||||||
# feasopt.tolerance: 1.e-6
|
random_seed: 123
|
||||||
|
gurobi-default:
|
||||||
|
threads: 4
|
||||||
|
method: 2 # barrier
|
||||||
|
crossover: 0
|
||||||
|
BarConvTol: 1.e-6
|
||||||
|
Seed: 123
|
||||||
|
AggFill: 0
|
||||||
|
PreDual: 0
|
||||||
|
GURO_PAR_BARDENSETHRESH: 200
|
||||||
|
seed: 10 # Consistent seed for all plattforms
|
||||||
|
gurobi-numeric-focus:
|
||||||
|
name: gurobi
|
||||||
|
NumericFocus: 3 # Favour numeric stability over speed
|
||||||
|
method: 2 # barrier
|
||||||
|
crossover: 0 # do not use crossover
|
||||||
|
BarHomogeneous: 1 # Use homogeneous barrier if standard does not converge
|
||||||
|
BarConvTol: 1.e-5
|
||||||
|
FeasibilityTol: 1.e-4
|
||||||
|
OptimalityTol: 1.e-4
|
||||||
|
ObjScale: -0.5
|
||||||
|
threads: 8
|
||||||
|
Seed: 123
|
||||||
|
gurobi-fallback: # Use gurobi defaults
|
||||||
|
name: gurobi
|
||||||
|
crossover: 0
|
||||||
|
method: 2 # barrier
|
||||||
|
BarHomogeneous: 1 # Use homogeneous barrier if standard does not converge
|
||||||
|
BarConvTol: 1.e-5
|
||||||
|
FeasibilityTol: 1.e-5
|
||||||
|
OptimalityTol: 1.e-5
|
||||||
|
Seed: 123
|
||||||
|
threads: 8
|
||||||
|
cplex-default:
|
||||||
|
threads: 4
|
||||||
|
lpmethod: 4 # barrier
|
||||||
|
solutiontype: 2 # non basic solution, ie no crossover
|
||||||
|
barrier_convergetol: 1.e-5
|
||||||
|
feasopt_tolerance: 1.e-6
|
||||||
|
|
||||||
|
cbc-default: {} # Used in CI
|
||||||
|
|
||||||
|
mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2
|
||||||
|
|
||||||
|
|
||||||
plotting:
|
plotting:
|
||||||
map:
|
map:
|
||||||
|
@ -373,8 +373,9 @@ def extra_functionality(n, snapshots):
|
|||||||
|
|
||||||
|
|
||||||
def solve_network(n, config, opts="", **kwargs):
|
def solve_network(n, config, opts="", **kwargs):
|
||||||
solver_options = config["solving"]["solver"].copy()
|
set_of_options = config['solving']['solver']['options']
|
||||||
solver_name = solver_options.pop("name")
|
solver_options = config['solving']["solver_options"][set_of_options] if set_of_options else {}
|
||||||
|
solver_name = config['solving']['solver']['name']
|
||||||
cf_solving = config["solving"]["options"]
|
cf_solving = config["solving"]["options"]
|
||||||
track_iterations = cf_solving.get("track_iterations", False)
|
track_iterations = cf_solving.get("track_iterations", False)
|
||||||
min_iterations = cf_solving.get("min_iterations", 4)
|
min_iterations = cf_solving.get("min_iterations", 4)
|
||||||
@ -411,7 +412,7 @@ if __name__ == "__main__":
|
|||||||
from _helpers import mock_snakemake
|
from _helpers import mock_snakemake
|
||||||
|
|
||||||
snakemake = mock_snakemake(
|
snakemake = mock_snakemake(
|
||||||
"solve_network", simpl="", clusters="5", ll="copt", opts="Co2L-BAU-CCL-24H"
|
"solve_network", simpl="", clusters="5", ll="v1.5", opts=""
|
||||||
)
|
)
|
||||||
configure_logging(snakemake)
|
configure_logging(snakemake)
|
||||||
|
|
||||||
@ -419,7 +420,7 @@ if __name__ == "__main__":
|
|||||||
if tmpdir is not None:
|
if tmpdir is not None:
|
||||||
Path(tmpdir).mkdir(parents=True, exist_ok=True)
|
Path(tmpdir).mkdir(parents=True, exist_ok=True)
|
||||||
opts = snakemake.wildcards.opts.split("-")
|
opts = snakemake.wildcards.opts.split("-")
|
||||||
solve_opts = snakemake.config["solving"]["options"]
|
solve_opts = snakemake.config['solving']['options']
|
||||||
|
|
||||||
fn = getattr(snakemake.log, "memory", None)
|
fn = getattr(snakemake.log, "memory", None)
|
||||||
with memory_logger(filename=fn, interval=30.0) as mem:
|
with memory_logger(filename=fn, interval=30.0) as mem:
|
||||||
|
Loading…
Reference in New Issue
Block a user