io.sarl.api.core
Capacity DefaultContextInteractions
All Superinterfaces:
Capacity
All Known Implementing Classes:
DefaultContextInteractionsSkill
capacity DefaultContextInteractions
implements Capacity
Gives access to the DefaultContext of the agent and common actions on its default space. Defines a set of commonly accessed action performed on the Default Space of the Default Context of the agent.
Property Summary
Modifier and type Property and description
Address defaultAddress
Return the Address of the agent in the Default Space of the Default Context.
AgentContext defaultContext
Returns the Default context fo the agent.
java.util.UUID defaultParentID
Replies the identifier of the default parent.
Scope<T> defaultParentScope
Replies the event scope that corresponds to the default parent.
EventSpace defaultSpace
Returns the Default Space of the Default Context.
Action Summary
Modifier and type Action and description
abstract void emit(Event,[Scope<T>])
Emits a given event with the provided scope in the DefaultSpace of the DefaultContext.
abstract void emitToParent(Event)
Emits or forward the given event to the parent agent into the default context of the calling agent.
abstract Address getDefaultAddress
Return the Address of the agent in the Default Space of the Default Context.
abstract AgentContext getDefaultContext
Returns the Default context fo the agent.
abstract java.util.UUID getDefaultParentID
Replies the identifier of the default parent.
abstract Scope<T> getDefaultParentScope
Replies the event scope that corresponds to the default parent.
abstract EventSpace getDefaultSpace
Returns the Default Space of the Default Context.
abstract boolean isDefaultContext(AgentContext)
Replies if the given context is the default context.
abstract boolean isDefaultContext(UUID)
Replies if the given identifier is the identifier of the default context.
abstract boolean isDefaultSpace(Space)
Replies if the given space is the default space of the default context.
abstract boolean isDefaultSpace(SpaceID)
Replies if the given identifier is the identifier of the default space of the default context.
abstract boolean isDefaultSpace(UUID)
Replies if the given identifier is the identifier of the default space of the default context.
abstract boolean isInDefaultSpace(Event)
Replies if the given event was emitted in the default space of the default context.
abstract java.util.UUID spawn(Class<T>,Object*)
Spawns a new Agent inside the default context of this agent.
Deprecated: See the Lifecycle capacity.
abstract void willReceive(UUID,Event)
Inverse signature of send.
Deprecated: since 0.11, see emit(Event,Scope)
Property Details
defaultAddress
val defaultAddress : Address
Return the Address of the agent in the Default Space of the Default Context. Equivalent to defaultContext.defaultSpace.getAddress(this.ID)

This property is an alias for the action: getDefaultAddress

Returns:
the address of the agent in the default space.
defaultContext
val defaultContext : AgentContext
Returns the Default context fo the agent.

This property is an alias for the action: getDefaultContext

Returns:
the default context.
defaultParentID
val defaultParentID : java.util.UUID
Replies the identifier of the default parent.

The default parent agent has the same identifier as the default context.

This property is an alias for the action: getDefaultParentID

Returns:
the identifier of the default parent of the current agent.
Since:
0.12
defaultParentScope
val defaultParentScope : Scope<T>
Replies the event scope that corresponds to the default parent.

This property is an alias for the action: getDefaultParentScope

Returns:
the identifier of the default parent of the current agent.
Since:
0.12
defaultSpace
val defaultSpace : EventSpace
Returns the Default Space of the Default Context. Equivalent to defaultContext.defaultSpace.

This property is an alias for the action: getDefaultSpace

Returns:
the default event space.
Action Details
emit(Event,[Scope<T>])
def emit(Event,[Scope<T>])
Emits a given event with the provided scope in the DefaultSpace of the DefaultContext. Equivalent to defaultContext.defaultSpace.emit(e,scope)
Parameters:
event - the event to emit.
Opt. Parameters:
emitToParent(Event)
def emitToParent(Event)
Emits or forward the given event to the parent agent into the default context of the calling agent.
Parameters:
event - the event to emit.
Since:
0.12
getDefaultAddress
def getDefaultAddress : Address
Return the Address of the agent in the Default Space of the Default Context. Equivalent to defaultContext.defaultSpace.getAddress(this.ID)
Returns:
the address of the agent in the default space.
getDefaultContext
def getDefaultContext : AgentContext
Returns the Default context fo the agent.
Returns:
the default context.
getDefaultParentID
def getDefaultParentID : java.util.UUID
Replies the identifier of the default parent.

The default parent agent has the same identifier as the default context.
Returns:
the identifier of the default parent of the current agent.
Since:
0.12
getDefaultParentScope
def getDefaultParentScope : Scope<T>
Replies the event scope that corresponds to the default parent.
Returns:
the identifier of the default parent of the current agent.
Since:
0.12
getDefaultSpace
def getDefaultSpace : EventSpace
Returns the Default Space of the Default Context. Equivalent to defaultContext.defaultSpace.
Returns:
the default event space.
isDefaultContext(AgentContext)
def isDefaultContext(AgentContext) : boolean
Replies if the given context is the default context.
Parameters:
context - the agent context to test.
Returns:
true if the given context is the default context. Otherwise false .
Since:
0.2
isDefaultContext(UUID)
def isDefaultContext(UUID) : boolean
Replies if the given identifier is the identifier of the default context.
Parameters:
contextID - the identifier of the context.
Returns:
true if the given identifier is the identifier of the default context. Otherwise false .
Since:
0.2
isDefaultSpace(Space)
def isDefaultSpace(Space) : boolean
Replies if the given space is the default space of the default context.
Parameters:
space - the space to test.
Returns:
true if the given space is the default space of the default context. Otherwise false .
Since:
0.2
isDefaultSpace(SpaceID)
def isDefaultSpace(SpaceID) : boolean
Replies if the given identifier is the identifier of the default space of the default context.
Parameters:
space - the space to test.
Returns:
true if the given identifier is the identifier of the default space of the default context. Otherwise false .
Since:
0.2
isDefaultSpace(UUID)
def isDefaultSpace(UUID) : boolean
Replies if the given identifier is the identifier of the default space of the default context.
Parameters:
space - the space to test.
Returns:
true if the given identifier is the identifier of the default space of the default context. Otherwise false .
Since:
0.2
isInDefaultSpace(Event)
def isInDefaultSpace(Event) : boolean
Replies if the given event was emitted in the default space of the default context.
Parameters:
event - the event to test.
Returns:
true if the given event is emitted in the default space of the default context. Otherwise false .
Since:
0.2
spawn(Class<T>,Object*)
def spawn(Class<T>,Object*) : java.util.UUID

fires AgentSpawned, AgentSpawnFailure

Spawns a new Agent inside the default context of this agent. This action must automatically register the newly created agent within the default space of the context.
Parameters:
agentType - the type of the agent to spawn.
params - the arguments to pass in the initialization event to the spawned agent.
Returns:
the identifier of the spawned agent.
Fires SARL events:
AgentSpawned in DefaultSpace, AgentSpawnFailure if the cannot be spawn.
Deprecated:
See the Lifecycle capacity.
willReceive(UUID,Event)
def willReceive(UUID,Event)
Inverse signature of send. Useful to send events using the agent's UUID.
Parameters:
receiver - the identifier of the expected receiver.
event - the event to emit.
Deprecated:
since 0.11, see emit(Event,Scope)
Since:
0.4