Class CompiledFluent
java.lang.Object
edu.uky.cs.nil.sabre.Fluent
edu.uky.cs.nil.sabre.comp.CompiledFluent
- All Implemented Interfaces:
Expression, Logical, Simplifiable, Typed, Signed, Unique, Serializable, Comparable<Logical>
A compiled fluent is a
fluent whose characters and signature are ground and which defines a
unique ID number which corresponds to the
fluent's index in its compiled problem's set
of fluents.- Author:
- Stephen G. Ware
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ImmutableArray<Character> An ordered list ofcharactersspecifying whose beliefs this fluent representsfinal intA unique ID number that corresponds to this fluent's index inits compiled problem's set of fluents -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompiledFluent(int id, Character character, CompiledFluent parent) Constructs a new compiled fluent by prepending a character onto a parent.protectedCompiledFluent(int id, Signature signature, Type type, String comment) Constructs a new compiled fluent with an empty list of characters. -
Method Summary
Modifier and TypeMethodDescriptionApplies a given function to every part of this logical formula and then creates a new logical formula of this same type using the results returned from the function.booleaninthashCode()booleanisGround()Tests whether this logical formula is ground, which means that it contains novariables.Returns an expression which represents a character's beliefs about this expression.Returns a new fluent where the first (leftmost) character has been removed fromFluent.characters.simplify()Returns a logically equivalent but smaller, simpler, or more convenient form of this logical formula.Methods inherited from class Fluent
compareTo, contains, evaluate, getSignature, is, isBoolean, isCharacter, isEntity, isNumber, isValued, negate, removeLastCharacter, toEffect, toPrecondition, toString, toValuedMethods inherited from interface Expression
mustBeValuedMethods inherited from interface Logical
collect, collect, collect, distinguish, find, find, find, mustBeGround, occurs, substitute, substituteMethods inherited from interface Typed
mustBe, mustBeBoolean, mustBeCharacter, mustBeEntity, mustBeNumber, mustNotBe, mustNotBeBoolean, mustNotBeCharacter, mustNotBeEntity, mustNotBeNumber
-
Field Details
-
id
public final int idA unique ID number that corresponds to this fluent's index inits compiled problem's set of fluents -
characters
An ordered list ofcharactersspecifying whose beliefs this fluent represents
-
-
Constructor Details
-
CompiledFluent
Constructs a new compiled fluent by prepending a character onto a parent.- Parameters:
id- a unique ID numbercharacter- the first character in this fluent's list of charactersparent- the fluent's parent; its signature will be copied and the character will be prepended to the start of its parent's list of characters
-
CompiledFluent
Constructs a new compiled fluent with an empty list of characters.- Parameters:
id- a unique ID numbersignature- the fluent's signature, which must be groundtype- the fluent's typecomment- the comment- Throws:
FormatException- if the signature is not ground
-
-
Method Details
-
equals
-
hashCode
-
isGround
-
apply
Description copied from interface:LogicalApplies a given function to every part of this logical formula and then creates a new logical formula of this same type using the results returned from the function. If, for every part of this formula, the function always returns its input as output with no changes, this method should return this object (not just any object that isequal tothis object).- Specified by:
applyin interfaceExpression- Specified by:
applyin interfaceLogical- Specified by:
applyin interfaceSimplifiable- Overrides:
applyin classFluent- Parameters:
function- the function to apply to all parts of this formula- Returns:
- a logical formula of the same type as this formula made from the returned objects, or this object if no parts were changed by the function
-
simplify
Description copied from interface:SimplifiableReturns a logically equivalent but smaller, simpler, or more convenient form of this logical formula.- Specified by:
simplifyin interfaceExpression- Specified by:
simplifyin interfaceSimplifiable- Overrides:
simplifyin classFluent- Returns:
- a smaller, simpler, or more convenient logical formula which is equivalent to this formula
-
prepend
Description copied from interface:ExpressionReturns an expression which represents a character's beliefs about this expression.- Specified by:
prependin interfaceExpression- Overrides:
prependin classFluent- Parameters:
character- the character whose beliefs will be represented- Returns:
- an expression representing the character's beliefs about this expression
-
removeFirstCharacter
Description copied from class:FluentReturns a new fluent where the first (leftmost) character has been removed fromFluent.characters. If there are no characters, this method returns the same fluent.- Overrides:
removeFirstCharacterin classFluent- Returns:
- a fluent with the first characters removed
-