public abstract class PropositionalFunction
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Domain |
domain |
protected java.lang.String |
name |
protected java.lang.String[] |
parameterClasses |
protected java.lang.String[] |
parameterOrderGroup |
protected java.lang.String |
pfClass
optional; allows propositional functions to be grouped by class names
|
Constructor and Description |
---|
PropositionalFunction(java.lang.String name,
Domain domain,
java.lang.String parameterClasses)
Initializes a propositional function with the given name, domain and parameter object classes.
|
PropositionalFunction(java.lang.String name,
Domain domain,
java.lang.String[] parameterClasses)
Initializes a propositional function with the given name, domain and parameter object classes.
|
PropositionalFunction(java.lang.String name,
Domain domain,
java.lang.String[] parameterClasses,
java.lang.String pfClassName)
Initializes a propositional function with the given name, domain, parameter object classes, and propositional function class name.
|
PropositionalFunction(java.lang.String name,
Domain domain,
java.lang.String[] parameterClasses,
java.lang.String[] parameterOrderGroup)
Initializes a propositional function with the given name, domain, parameter object classes, and the parameter order groups of the parameters.
|
PropositionalFunction(java.lang.String name,
Domain domain,
java.lang.String[] parameterClasses,
java.lang.String[] parameterOrderGroup,
java.lang.String pfClassName)
Initializes a propositional function with the given name, domain, parameter object classes,
the parameter order groups of the parameters, and the propositional function class name.
|
PropositionalFunction(java.lang.String name,
Domain domain,
java.lang.String parameterClasses,
java.lang.String pfClassName)
Initializes a propositional function with the given name, domain, parameter object classes, and propositional function class name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<GroundedProp> |
getAllGroundedPropsForState(State s)
Returns all possible groundings of this
PropositionalFunction for the given State |
static java.util.List<GroundedProp> |
getAllGroundedPropsFromPFList(java.util.List<PropositionalFunction> pfs,
State s)
Returns all possible groundings for all of the
PropositionalFunction s in the provided list for the given State . |
java.lang.String |
getClassName()
Returns the propositional function class name of this PF.
|
java.lang.String |
getName()
Returns the name of this propositional function.
|
java.lang.String[] |
getParameterClasses()
Returns the object classes of the parameters for this propositional function
|
java.lang.String[] |
getParameterOrderGroups()
Returns the parameter order group names for the parameters of this propositional function.
|
int |
hashCode() |
protected void |
init(java.lang.String name,
Domain domain,
java.lang.String[] parameterClasses,
java.lang.String[] parameterOrderGroup,
java.lang.String pfClass) |
boolean |
isTrue(State s,
java.lang.String params)
Returns whether the propositional function is true for the given state with the given parameters
params is expected to be comma delimited with no spaces between parameters.
|
abstract boolean |
isTrue(State s,
java.lang.String[] params)
Returns whether the propositional function is true for the given state with the given parameters
This version is preferred to the comma delimited version.
|
void |
setClassName(java.lang.String cn)
Sets the class name for this propositional function.
|
boolean |
somePFGroundingIsTrue(State s)
|
java.lang.String |
toString() |
protected java.lang.String name
protected Domain domain
protected java.lang.String[] parameterClasses
protected java.lang.String[] parameterOrderGroup
protected java.lang.String pfClass
public PropositionalFunction(java.lang.String name, Domain domain, java.lang.String parameterClasses)
name
- the name of the propositional functiondomain
- the domain to which this propositional function should be connected.parameterClasses
- a comma delineated string specifying the name of object classes that the parameters must satisfy.public PropositionalFunction(java.lang.String name, Domain domain, java.lang.String parameterClasses, java.lang.String pfClassName)
name
- the name of the propositional functiondomain
- the domain to which this propositional function should be connected.parameterClasses
- a comma delineated string specifying the name of object classes that the parameters must satisfy.pfClassName
- the name of the propositional function class to which this PF belongs.public PropositionalFunction(java.lang.String name, Domain domain, java.lang.String[] parameterClasses)
name
- the name of the propositional functiondomain
- the domain to which this propositional function should be connected.parameterClasses
- an array of strings specifying the name of object classes that the parameters must satisfy.public PropositionalFunction(java.lang.String name, Domain domain, java.lang.String[] parameterClasses, java.lang.String pfClassName)
name
- the name of the propositional functiondomain
- the domain to which this propositional function should be connected.parameterClasses
- an array of strings specifying the name of object classes that the parameters must satisfy.pfClassName
- the name of the propositional function class to which this PF belongs.public PropositionalFunction(java.lang.String name, Domain domain, java.lang.String[] parameterClasses, java.lang.String[] parameterOrderGroup)
name
- the name of the propositional functiondomain
- the domain to which this propositional function should be connected.parameterClasses
- an array of strings specifying the name of object classes that the parameters must satisfy.parameterOrderGroup
- an array of strings specifying order group names for the parameterspublic PropositionalFunction(java.lang.String name, Domain domain, java.lang.String[] parameterClasses, java.lang.String[] parameterOrderGroup, java.lang.String pfClassName)
name
- the name of the propositional functiondomain
- the domain to which this propositional function should be connected.parameterClasses
- an array of strings specifying the name of object classes that the parameters must satisfy.parameterOrderGroup
- an array of strings specifying order group names for the parameterspfClassName
- the name of the propositional function class to which this PF belongs.protected final void init(java.lang.String name, Domain domain, java.lang.String[] parameterClasses, java.lang.String[] parameterOrderGroup, java.lang.String pfClass)
public final java.lang.String getName()
public final java.lang.String[] getParameterClasses()
public final java.lang.String[] getParameterOrderGroups()
public final void setClassName(java.lang.String cn)
cn
- the propositional function class name to which this PF should be assigned.public final java.lang.String getClassName()
public final boolean isTrue(State s, java.lang.String params)
s
- the state that is being checkedparams
- the parameters being passed in to the propositional functionpublic abstract boolean isTrue(State s, java.lang.String[] params)
s
- the state that is being checkedparams
- the parameters being passed in to the propositional functionpublic static java.util.List<GroundedProp> getAllGroundedPropsFromPFList(java.util.List<PropositionalFunction> pfs, State s)
PropositionalFunction
s in the provided list for the given State
.pfs
- The list of PropositionalFunction
s for which all groundings will be returned.s
- the State
in which the groundings should be produced.List
of all possible groundings for all of the PropositionalFunction
s in the provided list for the given State
public java.util.List<GroundedProp> getAllGroundedPropsForState(State s)
PropositionalFunction
for the given State
s
- the State
in which all groundings will be returnedList
of all possible groundings of this PropositionalFunction
for the given State
public boolean somePFGroundingIsTrue(State s)
s
- the State
to test.GroundedProp
for the provided State
that is in true in the State
; false otherwise.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object