Description Usage Arguments Value Examples
View source: R/generateKnapsackItems.R
This function takes two arguments and returns a data frame containing knapsack items with random weights and values.
1 2 3 4 5 6 7 8 | generateKnapsackItems(
n = 1000,
seed = 42,
wMin = 1,
wMax = 4000,
vMin = 0,
vMax = 10000
)
|
n |
Number of desired items |
seed |
Seed for generating items |
wMin |
Minimum value for sampling item weights |
wMax |
Maximum value for sampling item weights |
vMin |
Minimum value for sampling item values |
vMax |
Maximum value for sampling item values |
A data frame containing items.
1 2 3 4 5 6 7 | ## Not run:
if(interactive()){
generateKnapsackItems()
generateKnapsackItems(n=20000, wMin=100, wMax=500, vMin=0, vMax=100)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.