|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecturdar.BString
public class BString
The BString
class represents the bit strings on which the organisms feed.
Each bit string is characterised by its binary sequence, length and metabolic history (i.e.
the species which it has been metabolised by).
* @author Philip Gerlee
Field Summary | |
---|---|
java.util.Vector<java.lang.Integer> |
H
The metabolic history of the string |
int |
length
The length of the string |
boolean[] |
S
The bit sequence |
Constructor Summary | |
---|---|
BString(boolean[] S)
Creates a string from a given bit sequence |
|
BString(boolean[] S,
java.util.Vector<java.lang.Integer> H)
Creates a string from a given bit sequence and metabolic history |
|
BString(int size,
double E,
int mode)
Creates a string with a given length of certain type with bitflips |
Method Summary | |
---|---|
double |
blockEntropy(int level)
Calculates the block entropy of string B |
BString |
change(int rule)
Applies a Cellular Automaton rule to the string once and returns the modified string |
BString |
cloneString()
Deep-copy of the string |
double |
deltaE(BString S0,
int L)
Calculates difference in entropy between this string and and another string |
double |
Entropy(int level)
Calculates the approximation of the entropy S of a string B |
boolean |
equals(BString Si)
Compares two strings |
boolean |
get(int i)
Returns bit at position i |
double |
getFraction()
Returns the fraction of ones in the string |
java.util.Vector<java.lang.Integer> |
getHistory()
Returns metabolic history |
void |
manipulate(int rule)
Applies a Cellular Automaton rule to the string once |
void |
printString()
Prints the string to Std.out |
void |
radiate(double rate)
Induce random bitflips, not really used |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int length
public boolean[] S
public java.util.Vector<java.lang.Integer> H
Constructor Detail |
---|
public BString(boolean[] S)
S
- The bit sequencepublic BString(boolean[] S, java.util.Vector<java.lang.Integer> H)
S
- The bit sequenceH
- metabolic historypublic BString(int size, double E, int mode)
size
- String lengthE
- Bitflip probabilitymode
- Different string modes:Method Detail |
---|
public boolean get(int i)
i
- position along the string
public java.util.Vector<java.lang.Integer> getHistory()
public void printString()
public void radiate(double rate)
rate
- probability of bitflippublic double getFraction()
public void manipulate(int rule)
rule
- the CA-rule applied to the stringpublic BString change(int rule)
rule
- the CA-rule applied to the string
public BString cloneString()
public boolean equals(BString Si)
public double Entropy(int level)
level
- the level at which the entropy is calculated
public double blockEntropy(int level)
level
- the level at which the block entropy is calculated
public double deltaE(BString S0, int L)
S0
- the string with which the difference is calculatedL
- the level of entropy calculation
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |