mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-08 10:28:52 -06:00
Reorganize imports; start moving data to instance.training_data
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
import miplearn
|
||||
from miplearn import Instance
|
||||
import numpy as np
|
||||
import pyomo.environ as pe
|
||||
from scipy.stats import uniform, randint, bernoulli
|
||||
from scipy.stats import uniform, randint
|
||||
from scipy.stats.distributions import rv_frozen
|
||||
|
||||
from miplearn.instance import Instance
|
||||
|
||||
|
||||
class ChallengeA:
|
||||
"""
|
||||
@@ -56,6 +56,7 @@ class MultiKnapsackInstance(Instance):
|
||||
"""
|
||||
|
||||
def __init__(self, prices, capacities, weights):
|
||||
super().__init__()
|
||||
assert isinstance(prices, np.ndarray)
|
||||
assert isinstance(capacities, np.ndarray)
|
||||
assert isinstance(weights, np.ndarray)
|
||||
@@ -241,6 +242,7 @@ class KnapsackInstance(Instance):
|
||||
"""
|
||||
|
||||
def __init__(self, weights, prices, capacity):
|
||||
super().__init__()
|
||||
self.weights = weights
|
||||
self.prices = prices
|
||||
self.capacity = capacity
|
||||
|
||||
Reference in New Issue
Block a user