Class FolAction

  • All Implemented Interfaces:
    java.lang.Iterable<FolAtom>, ActionName

    public class FolAction
    extends java.lang.Object
    implements java.lang.Iterable<FolAtom>, ActionName
    An action is a truth-valued function on the set of action names, which is denoted by the set of actions which are mapped to 'true'.
    Author:
    Sebastian Homann
    • Constructor Summary

      Constructors 
      Constructor Description
      FolAction()
      Creates a new action, which maps all action names to false.
      FolAction​(java.util.Set<FolAtom> actionNames)
      Creates a new action, which maps the given action names to true, and every thing else to false.
    • Method Summary

      Modifier and Type Method Description
      java.util.Set<FolAtom> getAtoms()
      Returns all atoms, e.g.
      java.lang.String getName()
      Returns the name of this action.
      boolean isGround()
      Checks whether this action is ground or not.
      java.util.Iterator<FolAtom> iterator()  
      FolAction substitute​(java.util.Map<? extends Term<?>,​? extends Term<?>> map)
      Substitutes terms in all non-zero-arity atoms in this action according to the given map.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • FolAction

        public FolAction()
        Creates a new action, which maps all action names to false.
      • FolAction

        public FolAction​(java.util.Set<FolAtom> actionNames)
        Creates a new action, which maps the given action names to true, and every thing else to false.
        Parameters:
        actionNames - a set of action names which are mapped to true by this action.
    • Method Detail

      • getAtoms

        public java.util.Set<FolAtom> getAtoms()
        Returns all atoms, e.g. all action names, that are mapped to true by this action.
        Returns:
        the set of atoms, that are contained in this action.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • substitute

        public FolAction substitute​(java.util.Map<? extends Term<?>,​? extends Term<?>> map)
        Substitutes terms in all non-zero-arity atoms in this action according to the given map. This is used for grounding, where variables are substituted by constants.
        Parameters:
        map - a map, containing all substitutions to be applied.
        Returns:
        the resulting action.
      • isGround

        public boolean isGround()
        Checks whether this action is ground or not. An action is ground when all action names are ground.
        Returns:
        true iff this action is ground
      • iterator

        public java.util.Iterator<FolAtom> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<FolAtom>
      • getName

        public java.lang.String getName()
        Description copied from interface: ActionName
        Returns the name of this action.
        Specified by:
        getName in interface ActionName
        Returns:
        the name of this action.