org.jscience.biology.lsystems.fixed
Class Rule

java.lang.Object
  extended by org.jscience.biology.lsystems.fixed.Rule

public class Rule
extends java.lang.Object

To represent a rule of an LSystem containing a predecessor a successor and a probability this class may be used.


Constructor Summary
Rule(char strPredecessor, java.lang.String strSuccessor)
          Constructor initializes predecessor and successor.
Rule(char strPredecessor, java.lang.String strSuccessor, float fProbability)
          Constructor allowing to initialize all three values
 
Method Summary
 char getPredecessor()
          Returns the predecessor value of this rule.
 float getProbability()
          Returns the probability of this rule.
 java.lang.String getSuccessor()
          Returns the successor value of this rule
 void setPredecessor(char strPredecessor)
          Stores a new predecessor in the member variable.
 void setProbability(float fProbability)
          Stores a new probability in the member variable.
 void setSuccessor(java.lang.String strSuccessor)
          Stores a new sucessor in the member variable.
 java.lang.String toString()
          Converts the rule to a string version and returns it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(char strPredecessor,
            java.lang.String strSuccessor,
            float fProbability)
Constructor allowing to initialize all three values

Parameters:
strPredecessor - The predecessor of this rule.
strSuccessor - The successor of the rule.
fProbability - The probability of the stochastic rule.

Rule

public Rule(char strPredecessor,
            java.lang.String strSuccessor)
Constructor initializes predecessor and successor. The probability is set to 1.

Parameters:
strPredecessor - The predecessor of this rule.
strSuccessor - The successor of the rule.
Method Detail

setPredecessor

public void setPredecessor(char strPredecessor)
Stores a new predecessor in the member variable.

Parameters:
strPredecessor - The new predecessor

setSuccessor

public void setSuccessor(java.lang.String strSuccessor)
Stores a new sucessor in the member variable.

Parameters:
strSuccessor - The new sucessor

setProbability

public void setProbability(float fProbability)
Stores a new probability in the member variable.

Parameters:
fProbability - The new probability

getPredecessor

public char getPredecessor()
Returns the predecessor value of this rule.

Returns:
The predecessor.

getSuccessor

public java.lang.String getSuccessor()
Returns the successor value of this rule

Returns:
The successor value.

getProbability

public float getProbability()
Returns the probability of this rule.

Returns:
The probability of this rule.

toString

public java.lang.String toString()
Converts the rule to a string version and returns it. The output of the string is in the form predecessor, rulesign, successor.

Overrides:
toString in class java.lang.Object
Returns:
The rule as a string.