Interface Blackboard

  • All Implemented Interfaces:
    com.embabel.agent.core.Bindable , com.embabel.agent.core.MayHaveLastResult , com.embabel.common.core.types.HasInfoString

    
    public interface Blackboard
     implements Bindable, MayHaveLastResult, HasInfoString
                        

    A Blackboard is how an AgentProcess maintains context. Blackboard operations are threadsafe. Blackboards are immutable in the sense that once an object has been added it cannot be removed. However, objects can be hidden so they are no longer visible to retrieval operations (e.g. driving planning).

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • get

         abstract Object get(String name)

        Return the value of a variable, if it is set by name. Does not limit return via type information.

      • hide

         abstract Unit hide(Object what)

        Hide this object. Does not remove it from the blackboard but will prevent it being retrieved.

      • getOrPut

         abstract <V extends Any> V getOrPut(String name, Function0<V> creator)

        Threadsafe get or put

      • getValue

         Object getValue(String variable, String type, DataDictionary dataDictionary)

        Resolve the value of a variable, if it is set. Resolve superclasses For example, getValue("it", "Animal") will match a Dog if Dog extends Animal

      • last

         <T extends Any> T last(Class<T> clazz)

        Last entry of the given type, if there is one

      • spawn

         abstract Blackboard spawn()

        Spawn an independent child blackboard based on the content of this

      • clear

        @ApiStatus.Internal() abstract Unit clear()

        Clear all entries from the blackboard. Not intended for use in user code.

      • getBlackboardId

         abstract String getBlackboardId()

        Unique identifier of this blackboard. Blackboard doesn't extend StableIdentified to avoid conflict with implementations that are otherwise identified

      • getObjects

         abstract List<Object> getObjects()

        Entries in the order they were added. The default instance of any type is the last one Objects are immutable and may not be removed.