Sends a notification to an agent. It may be used anywhere,
from any object and any thread. However it is best practice to call
the
sendTo
function defined in class
Agent
from an agent
code executed during a reaction.
The destination agent receives the notification with a declared null
source agent id, which may be recognized using the
isNullId
function of class
AgentId
.
This is not true when this call is performed during an standard agent
reaction. In that case the current reacting agent, known by the engine,
is provided as source agent.
The notification is immediately validated, that is made persistent,
if it is not sent from an agent reaction.
Be careful, does not use this method in the engine thread, sometime
engine.agent is null and it throws a NullPointerException.