io.sarl.lang.core
Interface Space
All Known Implementing Classes:
AbstractEventSpace, AbstractSpace, OpenLocalEventSpace
interface Space
Agents in SARL can interact only via Interaction Spaces. A space is the support of the event-driven interaction between agents respecting the rules defined in various Space Specifications.

Participants to the space are software entities, e.g. agents that are participating to the interaction in the space. Two types of participant are forseen:
  • strong participant: this is the standard or regular type. If the space has a strong participant, it is considered as an not empty space and cannot be destroyed from the system.
  • weak participant: this is a special type. If the space has only weak participants, i.e. no strong participant is involved, it is considered as en empty space and could be destroy from the system.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Property Summary
Modifier and type Property and description
int numberOfStrongParticipants
Replies the number of strong participants to the space.
int numberOfWeakParticipants
Replies the number of strong participants to the space.
SpaceID spaceID
Replies the Identification of this Interaction Space.
Action Summary
Modifier and type Action and description
abstract void forEachStrongParticipant(Procedure1<Param>)
Apply the given procedure to each of the strong participants.
abstract void forEachWeakParticipant(Procedure1<Param>)
Apply the given procedure to each of the weak participants.
abstract int getNumberOfStrongParticipants
Replies the number of strong participants to the space.
abstract int getNumberOfWeakParticipants
Replies the number of strong participants to the space.
abstract SpaceID getSpaceID
Replies the Identification of this Interaction Space.
default boolean isPseudoEmpty
Replies if the space could be considered as empty.
abstract boolean isPseudoEmpty(UUID)
Replies if the space is empty or the given identifier is associated to the only one participant to the space.
Property Details
numberOfStrongParticipants
val numberOfStrongParticipants : int
Replies the number of strong participants to the space. This function ignores the weak participants.

This property is an alias for the action: getNumberOfStrongParticipants

Returns:
the number of participants.
Since:
0.11
numberOfWeakParticipants
val numberOfWeakParticipants : int
Replies the number of strong participants to the space. This function ignores the weak participants.

This property is an alias for the action: getNumberOfWeakParticipants

Returns:
the number of participants.
Since:
0.11
spaceID
val spaceID : SpaceID
Replies the Identification of this Interaction Space.

This property is an alias for the action: getSpaceID

Returns:
the space's id
Action Details
forEachStrongParticipant(Procedure1<Param>)
def forEachStrongParticipant(Procedure1<Param>)
Apply the given procedure to each of the strong participants. This function ignores the weak participants.
Parameters:
callback - the lambda to invoke.
Since:
0.11
forEachWeakParticipant(Procedure1<Param>)
def forEachWeakParticipant(Procedure1<Param>)
Apply the given procedure to each of the weak participants. This function ignores the strong participants.
Parameters:
callback - the lambda to invoke.
Since:
0.11
getNumberOfStrongParticipants
def getNumberOfStrongParticipants : int
Replies the number of strong participants to the space. This function ignores the weak participants.
Returns:
the number of participants.
Since:
0.11
getNumberOfWeakParticipants
def getNumberOfWeakParticipants : int
Replies the number of strong participants to the space. This function ignores the weak participants.
Returns:
the number of participants.
Since:
0.11
getSpaceID
def getSpaceID : SpaceID
Replies the Identification of this Interaction Space.
Returns:
the space's id
isPseudoEmpty
def isPseudoEmpty : boolean
Replies if the space could be considered as empty. Usually an empty space is a space without relevant participant, i.e. weak participants are ignored by this function.
Returns:
true if the space could be considered as empty.
Since:
0.11
isPseudoEmpty(UUID)
def isPseudoEmpty(UUID) : boolean
Replies if the space is empty or the given identifier is associated to the only one participant to the space. Weak participants are ignored by this function.
Parameters:
id - the identifier to test.
Returns:
true if space if empty or the identifier is associated to the only one participant.
Since:
0.11