public class Knapsack extends Object
nbItems
types of items
with weights itemWeight
and profits itemProfit
.
The aim is to pick a combination of items (note that each type of items
can be picked multiple times) such that their total weight does not exceed
capacity
and total profit is maximized.Modifier and Type | Field and Description |
---|---|
jsdp.app.standalone.deterministic.Knapsack.ImmediateValueFunction<jsdp.app.standalone.deterministic.Knapsack.State,Double,Double> |
immediateValueFunction |
jsdp.app.standalone.deterministic.Knapsack.StateTransitionFunction<jsdp.app.standalone.deterministic.Knapsack.State,Double> |
stateTransition |
Constructor and Description |
---|
Knapsack(int nbItems,
double[] itemWeight,
double[] itemProfit,
double capacity) |
public jsdp.app.standalone.deterministic.Knapsack.StateTransitionFunction<jsdp.app.standalone.deterministic.Knapsack.State,Double> stateTransition
public Knapsack(int nbItems, double[] itemWeight, double[] itemProfit, double capacity)
public static void main(String[] args)
Copyright © 2017–2018. All rights reserved.