|
||||||||||
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.BitStringMatcher
public class BitStringMatcher
Discrete function to match the given bit string or a randomly generated bit string.
Constructor Summary | |
---|---|
BitStringMatcher()
Constructor. |
Method Summary | |
---|---|
double |
evaluate(Vector x)
Evaluate the fitness of the provided solution x . |
BitStringMatcher |
getClone()
Create a cloned copy of the current object and return it. |
int |
getNumberOfBits()
Get the number of bits in the bit string that must be matched. |
String |
getTargetRandomString()
Get the target random bit string to match. |
void |
setDomain(String newDomain)
Set the domain of the function and generate a random bit string. |
void |
setTargetRandomString(String target)
Set the target random bit string to match. |
Methods inherited from class net.sourceforge.cilib.functions.DiscreteFunction |
---|
evaluate, getMaximum, getMinimum |
Methods inherited from class net.sourceforge.cilib.functions.Function |
---|
getBehavioralDomainRegistry, getDimension, getDomain, getDomainRegistry, setBehavioralDomain, setBehaviouralDomainRegistry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitStringMatcher()
Method Detail |
---|
public BitStringMatcher getClone()
Cloneable
Object.clone()
public void setDomain(String newDomain)
setTargetRandomString(String)
.
The super classes setDomain() is called before the random bit string is generated.
setDomain
in class Function
newDomain
- The string representation of the doamin to set.public String getTargetRandomString()
public void setTargetRandomString(String target)
target
- The target random bit string to setpublic int getNumberOfBits()
public double evaluate(Vector x)
x
. The provided
solution is compared, bit for bit to the target solution and every match
results in a better fitness. Non-matching bits are not penalised.
evaluate
in class DiscreteFunction
x
- The potential solution provided
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |