Package com.anylogic.engine
- All Superinterfaces:
AbstractLinkToAgent<T,,A> Serializable
- All Known Implementing Classes:
LinkToAgentImpl
public interface LinkToAgent<T extends Agent,A extends Agent> extends AbstractLinkToAgent<T,A>
| Modifier and Type | Method | Description |
|---|---|---|
void | connectTo |
Creates a uni-directional connection between this agent and a given
other agent.
|
void | deliver |
Deprecated.
this function is deprecated since AnyLogic 8.9.2.
|
boolean | disconnect() |
Disconnects this agent from another given agent.
|
T | getConnectedAgent() |
Returns connected agent
|
boolean | isConnected() |
Tests if this link is connected to some agent.
|
void | send |
Sends a message to connected agent.
|
T getConnectedAgent()
Returns connected agent
- Returns:
- connected agent or
nullif this link isn't connected
boolean isConnected()
Tests if this link is connected to some agent.
- Returns:
trueif the link is connected,falseotherwise- See Also:
-
getConnectedAgent()
void connectTo(T a)
Creates a uni-directional connection between this agent and a given
other agent. Raises error if you try to connect to itself. Does
nothing if agents are already connected. Performs disconnect -
in case when link was previously connected to some other agent.
- Parameters:
a- another agent
boolean disconnect()
Disconnects this agent from another given agent.
- Parameters:
a- another agent- Returns:
trueif the agents were connected,falseotherwise
void send(Object msg)
Sends a message to connected agent. The message will be delivered during
a separate event scheduled to occur in zero time after the current one.
- Parameters:
msg- a message
@Deprecated void deliver(Object msg)
Deprecated.
this function is deprecated since AnyLogic 8.9.2. Please use
send(Object) instead
Delivers a message to connected given agent immediately during this method call.
If you wish this to happen in a separate event, use send() method.- Parameters:
msg- a message