Package fr.uga.pddl4j.problem.operator
Class AbstractFluentDescription
java.lang.Object
fr.uga.pddl4j.problem.operator.AbstractFluentDescription
- All Implemented Interfaces:
FluentDescription
,Serializable
- Direct Known Subclasses:
Condition
,Effect
,InitialState
This class implements a common methods to manipulate a fluent description.
- Since:
- 4.0
- See Also:
BitVector
, Serialized Form
-
Constructor Summary
ConstructorDescriptionCreates a new fluent description.Creates a new fluent description from an other one.AbstractFluentDescription(BitVector positive, BitVector negative)
Creates a new fluent description from a specified positive and negative timed fluent description. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the cardinality of the fluent description, i.e., the number of fluents defined the positive and negative timed fluent description.Returns the positive fluents of the fluent description.Returns the positive fluents of the fluent description.boolean
Returns if this abstract fluent description is consistent.boolean
isEmpty()
Returns if fluent description is empty, i.e., if the fluent description has no positive and no negative fluent.
-
Constructor Details
-
AbstractFluentDescription
public AbstractFluentDescription()Creates a new fluent description. By default the fluent description has no positive and no negative fluents. -
AbstractFluentDescription
Creates a new fluent description from an other one. This constructor create a deep copy of the object in parameter.- Parameters:
other
- the other one.
-
AbstractFluentDescription
Creates a new fluent description from a specified positive and negative timed fluent description.- Parameters:
positive
- the positive bit vector of fluent description.negative
- the positive bit vector of fluent description.
-
-
Method Details
-
getPositiveFluents
Returns the positive fluents of the fluent description.- Specified by:
getPositiveFluents
in interfaceFluentDescription
- Returns:
- the positive fluents of the goal description.
-
getNegativeFluents
Returns the positive fluents of the fluent description.- Specified by:
getNegativeFluents
in interfaceFluentDescription
- Returns:
- the negative fluents of the goal description.
-
isEmpty
public boolean isEmpty()Returns if fluent description is empty, i.e., if the fluent description has no positive and no negative fluent. Such a goal description is always true.- Specified by:
isEmpty
in interfaceFluentDescription
- Returns:
true
if the fluent description is empty;false
otherwise.
-
cardinality
public final int cardinality()Returns the cardinality of the fluent description, i.e., the number of fluents defined the positive and negative timed fluent description.- Specified by:
cardinality
in interfaceFluentDescription
- Returns:
- the cardinality of the goal description.
-
isConsistent
public final boolean isConsistent()Returns if this abstract fluent description is consistent. A fluent description is consistent a fluent is at the same postive and negative.- Specified by:
isConsistent
in interfaceFluentDescription
- Returns:
true
if this abstract fluent description is consistentfalse
otherwise.
-