mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Implement MemorizingLazyConstrComponent
This commit is contained in:
22
tests/fixtures/gen_tsp.py
vendored
Normal file
22
tests/fixtures/gen_tsp.py
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
from os.path import dirname
|
||||
|
||||
import numpy as np
|
||||
from scipy.stats import uniform, randint
|
||||
|
||||
from miplearn.collectors.basic import BasicCollector
|
||||
from miplearn.io import write_pkl_gz
|
||||
from miplearn.problems.tsp import TravelingSalesmanGenerator, build_tsp_model
|
||||
|
||||
np.random.seed(42)
|
||||
gen = TravelingSalesmanGenerator(
|
||||
x=uniform(loc=0.0, scale=1000.0),
|
||||
y=uniform(loc=0.0, scale=1000.0),
|
||||
n=randint(low=20, high=21),
|
||||
gamma=uniform(loc=1.0, scale=0.25),
|
||||
fix_cities=True,
|
||||
round=True,
|
||||
)
|
||||
data = gen.generate(3)
|
||||
data_filenames = write_pkl_gz(data, dirname(__file__), prefix="tsp-n20-")
|
||||
collector = BasicCollector()
|
||||
collector.collect(data_filenames, build_tsp_model)
|
||||
BIN
tests/fixtures/tsp-n20-00000.h5
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00000.h5
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00000.mps.gz
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00000.mps.gz
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00000.pkl.gz
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00000.pkl.gz
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00001.h5
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00001.h5
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00001.mps.gz
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00001.mps.gz
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00001.pkl.gz
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00001.pkl.gz
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00002.h5
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00002.h5
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00002.mps.gz
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00002.mps.gz
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/tsp-n20-00002.pkl.gz
vendored
Normal file
BIN
tests/fixtures/tsp-n20-00002.pkl.gz
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user