logic
Class ProbabilisticNext

java.lang.Object
  extended by logic.Formula
      extended by logic.ProbabilisticNext

public class ProbabilisticNext
extends Formula

Probabilistic Next

Represents a subformula containing at least one probabilistic expression.

Copyright(c) 2005 Université Laval, LSFM research group.

Version:
1.0
Author:
Nicolas Richard

Field Summary
 
Fields inherited from class logic.Formula
subFormula
 
Constructor Summary
ProbabilisticNext(java.lang.String action, double probability, Formula subFormula)
          Represents a probabilistic expression followed by a subformula.
 
Method Summary
 boolean equals(java.lang.Object o)
          Determines if the specified object is a Probabilistic Next operator
 java.lang.String getAction()
          Access the action attached to the probabilistic expression
 double getProbability()
          Access the probability attached to the probabilistic expression
 java.lang.String getType()
          Return a string that identifies a Probabilistic Next operator
 void setAction(java.lang.String action)
          Sets the action attached to the probabilistic expression
 void setProbability(double probability)
          Sets the probability attached to the probabilistic expression
 java.lang.String toString()
          Converts the expression to a string recognizable by the parser
 
Methods inherited from class logic.Formula
depth, getSubFormula, setSubFormula
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProbabilisticNext

public ProbabilisticNext(java.lang.String action,
                         double probability,
                         Formula subFormula)
Represents a probabilistic expression followed by a subformula. TODO: We should verify that 0 <= probability <= 1, but we should first create a child class of ProbabilisticNext for an invalid expression.

Parameters:
action - the action attached to the expression
probability - the minimum probability of occurence
subFormula - the subformula following this expression
Method Detail

toString

public java.lang.String toString()
Converts the expression to a string recognizable by the parser

Overrides:
toString in class Formula
Returns:
the expression converted to a string

getAction

public java.lang.String getAction()
Access the action attached to the probabilistic expression

Returns:
the action attached to the probabilistic expression

setAction

public void setAction(java.lang.String action)
Sets the action attached to the probabilistic expression

Parameters:
action - the action to attach

getProbability

public double getProbability()
Access the probability attached to the probabilistic expression

Returns:
the probability attached to the probabilistic expression

setProbability

public void setProbability(double probability)
Sets the probability attached to the probabilistic expression

Parameters:
probability - the probability to attach

getType

public java.lang.String getType()
Return a string that identifies a Probabilistic Next operator

Specified by:
getType in class Formula
Returns:
a string that identifies a Probabilistic Next operator

equals

public boolean equals(java.lang.Object o)
Determines if the specified object is a Probabilistic Next operator

Overrides:
equals in class Formula
Parameters:
o - the object to verify
Returns:
'True' if the object is indeed a Probabilistic Next operator, 'False' otherwise.