|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.functions.Function net.sourceforge.cilib.functions.DiscreteFunction net.sourceforge.cilib.functions.discrete.KnapSack
public class KnapSack
Perform the knapsack problem optimisation.
Constructor Summary | |
---|---|
KnapSack()
|
Method Summary | |
---|---|
double |
evaluate(Vector x)
Evaluate the function output, given the function input, x . |
int |
getCapacity()
|
KnapSack |
getClone()
Create a cloned copy of the current object and return it. |
Object |
getMaximum()
Accessor for the function maximum. |
Object |
getMinimum()
Accessor for the function minimum. |
int |
getNumberOfObjects()
|
ArrayList<Double> |
getValue()
|
ArrayList<Double> |
getWeight()
|
void |
setCapacity(int capacity)
|
void |
setNumberOfObjects(int numberOfObjects)
|
void |
setValue(ArrayList<Double> value)
|
void |
setValue(String valueString)
Helper method. |
void |
setWeight(ArrayList<Double> weight)
|
void |
setWeight(String weightString)
Helper method. |
Methods inherited from class net.sourceforge.cilib.functions.DiscreteFunction |
---|
evaluate |
Methods inherited from class net.sourceforge.cilib.functions.Function |
---|
getBehavioralDomainRegistry, getDimension, getDomain, getDomainRegistry, setBehavioralDomain, setBehaviouralDomainRegistry, setDomain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KnapSack()
Method Detail |
---|
public KnapSack getClone()
Cloneable
Object.clone()
public Object getMinimum()
DiscreteFunction
getMinimum
in class DiscreteFunction
public Object getMaximum()
DiscreteFunction
getMaximum
in class DiscreteFunction
public double evaluate(Vector x)
DiscreteFunction
x
.
evaluate
in class DiscreteFunction
x
- The Vector representing the function input.
public int getCapacity()
public void setCapacity(int capacity)
capacity
- The capacity to set.public int getNumberOfObjects()
public void setNumberOfObjects(int numberOfObjects)
numberOfObjects
- The numberOfObjects to set.public ArrayList<Double> getValue()
public void setValue(ArrayList<Double> value)
value
- The value to set.public void setValue(String valueString)
valueString
- A comma separated string defining the values for
each selection bucket.public ArrayList<Double> getWeight()
public void setWeight(ArrayList<Double> weight)
weight
- The weight to set.public void setWeight(String weightString)
weightString
- A comma separated string defining the weight value for
each selection bucket.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |