AnyLogic
Expand
Font size
All Superinterfaces:
AbstractLinkToAgent<T,A>, Serializable
All Known Implementing Classes:
LinkToAgentImpl

public interface LinkToAgent<T extends Agent,A extends Agent>
extends AbstractLinkToAgent<T,A>

Method Summary

Modifier and TypeMethodDescription
voidconnectTo(T a)
Creates a uni-directional connection between this agent and a given other agent.
voiddeliver(Object msg)
Deprecated.
this function is deprecated since AnyLogic 8.9.2.
booleandisconnect()
Disconnects this agent from another given agent.
TgetConnectedAgent()
Returns connected agent
booleanisConnected()
Tests if this link is connected to some agent.
voidsend(Object msg)
Sends a message to connected agent.

Method Details

getConnectedAgent

T getConnectedAgent()
Returns connected agent
Returns:
connected agent or null if this link isn't connected

isConnected

boolean isConnected()
Tests if this link is connected to some agent.
Returns:
true if the link is connected, false otherwise
See Also:
getConnectedAgent()

connectTo

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

disconnect

boolean disconnect()
Disconnects this agent from another given agent.
Parameters:
a - another agent
Returns:
true if the agents were connected, false otherwise

send

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

deliver

@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