mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Knapsack: minor correction to docs; update docstrings
This commit is contained in:
@@ -93,7 +93,7 @@ If `fix_w=True` is provided, then $w_{ij}$ are kept the same in all generated in
|
|||||||
|
|
||||||
If a probability distribution `w_jitter` is provided, then item weights will be set to $w_{ij} + \gamma_{ij}$ where $\gamma_{ij}$ is sampled from `w_jitter`. When combined with `fix_w=True`, this argument may be used to generate instances where the weight of each item is roughly the same, but not exactly identical, across all instances. The prices of the items and the capacities of the knapsacks will be calculated as above, but using these perturbed weights instead.
|
If a probability distribution `w_jitter` is provided, then item weights will be set to $w_{ij} + \gamma_{ij}$ where $\gamma_{ij}$ is sampled from `w_jitter`. When combined with `fix_w=True`, this argument may be used to generate instances where the weight of each item is roughly the same, but not exactly identical, across all instances. The prices of the items and the capacities of the knapsacks will be calculated as above, but using these perturbed weights instead.
|
||||||
|
|
||||||
By default, all generated prices, weights and capacities are rounded to the nearest number. If `round=False` is provided, this rounding will be disabled.
|
By default, all generated prices, weights and capacities are rounded to the nearest integer number. If `round=False` is provided, this rounding will be disabled.
|
||||||
|
|
||||||
!!! note "References"
|
!!! note "References"
|
||||||
* Freville, Arnaud, and Gérard Plateau. *An efficient preprocessing procedure for the multidimensional 0–1 knapsack problem.* Discrete applied mathematics 49.1-3 (1994): 189-212.
|
* Freville, Arnaud, and Gérard Plateau. *An efficient preprocessing procedure for the multidimensional 0–1 knapsack problem.* Discrete applied mathematics 49.1-3 (1994): 189-212.
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ class MultiKnapsackGenerator:
|
|||||||
from w[i,j], as long as u and K are not constants, the generated instances will still not
|
from w[i,j], as long as u and K are not constants, the generated instances will still not
|
||||||
be completely identical.
|
be completely identical.
|
||||||
|
|
||||||
|
|
||||||
If a probability distribution w_jitter is provided, then item weights will be set to
|
If a probability distribution w_jitter is provided, then item weights will be set to
|
||||||
w[i,j] + gamma[i,j] where gamma[i,j] is sampled from w_jitter. When combined with
|
w[i,j] + gamma[i,j] where gamma[i,j] is sampled from w_jitter. When combined with
|
||||||
fix_w=True, this argument may be used to generate instances where the weight of each item
|
fix_w=True, this argument may be used to generate instances where the weight of each item
|
||||||
@@ -138,6 +137,9 @@ class MultiKnapsackGenerator:
|
|||||||
items and the capacities of the knapsacks will be calculated as above, but using these
|
items and the capacities of the knapsacks will be calculated as above, but using these
|
||||||
perturbed weights instead.
|
perturbed weights instead.
|
||||||
|
|
||||||
|
By default, all generated prices, weights and capacities are rounded to the nearest integer
|
||||||
|
number. If `round=False` is provided, this rounding will be disabled.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
n: rv_discrete
|
n: rv_discrete
|
||||||
|
|||||||
Reference in New Issue
Block a user