Class Character

java.lang.Object
edu.uky.cs.nil.sabre.Entity
edu.uky.cs.nil.sabre.Character
All Implemented Interfaces:
Expression, Logical, Parameter, Simplifiable, Typed, Value, Unique, Serializable, Comparable<Logical>

public class Character extends Entity
A character is a special entity that represents an intelligent being with its own (possibly wrong) beliefs about the world state and its own utility function that it will attempt to maximize. The term 'character' is used instead of 'agent' to emphasize that, while a character's actions need to make sense based on their beliefs and intentions, they are not actually independent decision-makers. The planner is the only decision-maker, but it should ensure that characters appear to be acting like independent agents.

Characters are always listed first in Universe.entities so that their ID numbers correspond to their index in both Universe.entities and Universe.characters.

Author:
Stephen G. Ware
See Also:
  • Method Details

    • apply

      public Character apply(Function<Object,Object> function)
      Description copied from interface: Logical
      Applies 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 is equal to this object).
      Specified by:
      apply in interface Expression
      Specified by:
      apply in interface Logical
      Specified by:
      apply in interface Parameter
      Specified by:
      apply in interface Simplifiable
      Specified by:
      apply in interface Value
      Overrides:
      apply in class Entity
      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
    • isCharacter

      public boolean isCharacter()
      Description copied from interface: Typed
      Tests whether this formula is of type character.
      Specified by:
      isCharacter in interface Typed
      Overrides:
      isCharacter in class Entity
      Returns:
      true if the formula is of type character, false otherwise
    • simplify

      public Character simplify()
      Description copied from interface: Simplifiable
      Returns a logically equivalent but smaller, simpler, or more convenient form of this logical formula.
      Specified by:
      simplify in interface Expression
      Specified by:
      simplify in interface Parameter
      Specified by:
      simplify in interface Simplifiable
      Specified by:
      simplify in interface Value
      Overrides:
      simplify in class Entity
      Returns:
      a smaller, simpler, or more convenient logical formula which is equivalent to this formula
    • evaluate

      public Character evaluate(State state)
      Description copied from interface: Expression
      Returns the value of this expression in a given state.
      Specified by:
      evaluate in interface Expression
      Specified by:
      evaluate in interface Value
      Overrides:
      evaluate in class Entity
      Parameters:
      state - the state in which this expression will be evaluated
      Returns:
      the value of this expression
    • prepend

      public Character prepend(Parameter character)
      Description copied from interface: Expression
      Returns an expression which represents a character's beliefs about this expression.
      Specified by:
      prepend in interface Expression
      Specified by:
      prepend in interface Parameter
      Specified by:
      prepend in interface Value
      Overrides:
      prepend in class Entity
      Parameters:
      character - the character whose beliefs will be represented
      Returns:
      an expression representing the character's beliefs about this expression