LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.beliefbase.IBaseBeliefbase Class Referenceabstract

default behaviour of a beliefbase More...

+ Inheritance diagram for org.lightjason.agentspeak.beliefbase.IBaseBeliefbase:
+ Collaboration diagram for org.lightjason.agentspeak.beliefbase.IBaseBeliefbase:

Public Member Functions

ILiteral add ( @Nonnull final ILiteral p_literal)
 adds a literal More...
 
final IView create ( @Nonnull final String p_name)
 returns a new view of the belief base More...
 
final IView create ( @Nonnull final String p_name, final IView p_parent)
 
ILiteral remove ( @Nonnull final ILiteral p_literal)
 removes a literal More...
 
Stream< ITriggertrigger ( @Nonnull final IView p_view)
 returns all trigger of the beliefbase More...
 
IAgent<?> update ( @Nonnull final IAgent<?> p_agent)
 updates all items More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.beliefbase.IBeliefbase
IView add ( @Nonnull final IView p_view)
 adds a view More...
 
IBeliefbase clear ()
 clears all elements More...
 
boolean containsLiteral ( @Nonnull final String p_key)
 contains a multi-element More...
 
boolean containsView ( @Nonnull final String p_key)
 contains a single-element More...
 
IView create ( @Nonnull final String p_name, @Nullable final IView p_parent)
 returns a new view of the belief base More...
 
Collection< ILiteralliteral ( @Nonnull final String p_key)
 returns a literal by the name More...
 
IView remove ( @Nonnull final IView p_view)
 removes a view More...
 
Stream< ILiteralstreamLiteral ()
 returns a stream over all literals More...
 
Stream< IViewstreamView ()
 returns a stream over all views More...
 
IView view ( @Nonnull final String p_key)
 returns a view element More...
 
IView viewOrDefault ( @Nonnull final String p_key, @Nullable final IView p_default)
 returns a view element More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.beliefbase.IStructure
boolean empty ()
 checks if the structure empty More...
 
int size ()
 returns the size of literals More...
 

Protected Member Functions

final Stream< ITriggercleartrigger (final IView p_view)
 copy of all trigger values More...
 
ILiteral event (final ITrigger.EType p_event, final ILiteral p_literal)
 push an event and literal to the event map More...
 
IView eventreference (final IView p_view)
 adds a view to the event referencing structure More...
 
final IView internalremove (final IView p_view)
 removes the interal view references More...
 

Private Attributes

final Multimap< IView, ITriggerm_events = Multimaps.synchronizedSetMultimap( HashMultimap.create() )
 map with events for a mask More...
 
final ReferenceQueue< IViewm_maskreference = new ReferenceQueue<>()
 weak reference queue of all masks to avoid memory-leaks of belief events More...
 
final Set< IViewm_views = Collections.synchronizedSet( new HashSet<>() )
 set with all current views More...
 

Additional Inherited Members

- Public Attributes inherited from org.lightjason.agentspeak.beliefbase.IBeliefbase
IBeliefbase EMPY
 empty beliefbase More...
 

Detailed Description

Member Function Documentation

◆ add()

ILiteral org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.add ( @Nonnull final ILiteral  p_literal)
Parameters
p_literalliteral without path
Returns
beliefbase reference

Implements org.lightjason.agentspeak.beliefbase.IBeliefbase.

Definition at line 91 of file IBaseBeliefbase.java.

References org.lightjason.agentspeak.language.instantiable.plan.trigger.ITrigger.EType.ADDBELIEF.

◆ cleartrigger()

final Stream<ITrigger> org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.cleartrigger ( final IView  p_view)
protected
Parameters
p_viewtrigger of this view
Returns
set with trigger values

Definition at line 174 of file IBaseBeliefbase.java.

◆ create() [1/2]

final IView org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.create ( @Nonnull final String  p_name)

◆ create() [2/2]

final IView org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.create ( @Nonnull final String  p_name,
final IView  p_parent 
)

Definition at line 84 of file IBaseBeliefbase.java.

◆ event()

ILiteral org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.event ( final ITrigger.EType  p_event,
final ILiteral  p_literal 
)
protected
Parameters
p_eventevent
p_literalliteral

Definition at line 135 of file IBaseBeliefbase.java.

References org.lightjason.agentspeak.language.instantiable.plan.trigger.CTrigger.from().

Referenced by org.lightjason.agentspeak.beliefbase.CBeliefbase.clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventreference()

IView org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.eventreference ( final IView  p_view)
protected
Parameters
p_viewview
Returns
input view

Definition at line 161 of file IBaseBeliefbase.java.

References org.lightjason.agentspeak.beliefbase.view.IView.add().

+ Here is the call graph for this function:

◆ internalremove()

final IView org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.internalremove ( final IView  p_view)
protected
Parameters
p_viewview to remove
Returns
view

Definition at line 148 of file IBaseBeliefbase.java.

References org.lightjason.agentspeak.beliefbase.view.IView.remove().

Referenced by org.lightjason.agentspeak.beliefbase.CBeliefbase.remove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

ILiteral org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.remove ( @Nonnull final ILiteral  p_literal)
Parameters
p_literalwithout path
Returns
beliefbase reference

Implements org.lightjason.agentspeak.beliefbase.IBeliefbase.

Definition at line 98 of file IBaseBeliefbase.java.

References org.lightjason.agentspeak.language.instantiable.plan.trigger.ITrigger.EType.DELETEBELIEF.

◆ trigger()

Stream<ITrigger> org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.trigger ( @Nonnull final IView  p_view)
Parameters
p_viewmask for events
Returns
set with trigger events

Implements org.lightjason.agentspeak.beliefbase.IBeliefbase.

Definition at line 123 of file IBaseBeliefbase.java.

◆ update()

IAgent<?> org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.update ( @Nonnull final IAgent<?>  p_agent)
Parameters
p_agentagent which runs the update call
Returns
agent
Warning
call update on a storage and on all storage-view, if exists different views which are point to the same storage, the update is called more than once, so the storage must limit the number of update calls

Implements org.lightjason.agentspeak.beliefbase.IStructure.

Definition at line 105 of file IBaseBeliefbase.java.

References org.lightjason.agentspeak.beliefbase.view.IView.remove().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_events

final Multimap<IView, ITrigger> org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.m_events = Multimaps.synchronizedSetMultimap( HashMultimap.create() )
private

Definition at line 64 of file IBaseBeliefbase.java.

◆ m_maskreference

final ReferenceQueue<IView> org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.m_maskreference = new ReferenceQueue<>()
private

Definition at line 72 of file IBaseBeliefbase.java.

◆ m_views

final Set<IView> org.lightjason.agentspeak.beliefbase.IBaseBeliefbase.m_views = Collections.synchronizedSet( new HashSet<>() )
private

Definition at line 68 of file IBaseBeliefbase.java.