|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectExamplesJaCoP.Example
ExamplesJaCoP.KnapsackExample
public class KnapsackExample
It shows the capabilities and usage of Knapsack constraint.
| Field Summary | |
|---|---|
java.lang.String[] |
args
It stores the parameters of the main function to be used by the model functions. |
| Fields inherited from class ExamplesJaCoP.Example |
|---|
cost, search, store, vars |
| Constructor Summary | |
|---|---|
KnapsackExample()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
It executes the two different models to find a solution to a knapsack problem. |
void |
model()
It specifies a standard way of modeling the problem. |
void |
modelBasic()
It creates a model where quantity variable is allowed only to be between 0 and 1, so if the original description allows n items n copies of that items must be created. |
void |
modelBoth()
It does not use Knapsack constraint only SumWeight constraints. |
void |
modelNoKnapsackConstraint()
It does not use Knapsack constraint only SumWeight constraints. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String[] args
| Constructor Detail |
|---|
public KnapsackExample()
| Method Detail |
|---|
public void model()
Example
model in class Examplepublic void modelNoKnapsackConstraint()
public void modelBoth()
public void modelBasic()
public static void main(java.lang.String[] args)
args -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||