Package com.tnsai.environment
Record Class ActionOutcome
java.lang.Object
java.lang.Record
com.tnsai.environment.ActionOutcome
public record ActionOutcome(boolean success, String description, Percept resultingPercept)
extends Record
Result of an agent acting on the environment.
-
Constructor Summary
ConstructorsConstructorDescriptionActionOutcome(boolean success, String description, Percept resultingPercept) Creates an instance of aActionOutcomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.static ActionOutcomefinal inthashCode()Returns a hash code value for this object.Returns the value of theresultingPerceptrecord component.booleansuccess()Returns the value of thesuccessrecord component.static ActionOutcomestatic ActionOutcomefinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ActionOutcome
Creates an instance of aActionOutcomerecord class.- Parameters:
success- the value for thesuccessrecord componentdescription- the value for thedescriptionrecord componentresultingPercept- the value for theresultingPerceptrecord component
-
-
Method Details
-
success
-
success
-
failure
-
getResultingPercept
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
resultingPercept
Returns the value of theresultingPerceptrecord component.- Returns:
- the value of the
resultingPerceptrecord component
-