Package com.anylogic.engine
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getConnectedAgent
- isConnected
- doConnect_xjal
- doDisconnect_xjal
- onReceive
- connectTo
- disconnect
- send
- deliver
- getBidirectionalPeer_xjal
- getOwner
- onDestroy
- onDestroy
- getLinkToAgentCommonAnimationSettings
- getLinkToAgentMyAnimationSettings
- isDeliverToAgent_xjal
- isVisible
- setVisible
- getLineColor
- setLineColor
- getLineWidth
- setLineWidth
- getLineStyle
- setLineStyle
- getArrowStyle
- setArrowStyle
- getArrowLocation
- setArrowLocation
- copyFrom_xjal
- java.lang.Object
- com.anylogic.engine.LinkToAgentImpl<T,
- All Implemented Interfaces:
AbstractLinkToAgent<T,,A> AgentDestroyListener,LinkToAgent<T,,A> LinkToAgentAnimationSettings,Serializable
public class LinkToAgentImpl<T extends Agent,A extends Agent> extends Object implements LinkToAgent<T,A>
- See Also:
- Serialized Form
| Constructor | Description |
|---|---|
LinkToAgentImpl |
| Modifier and Type | Method | Description |
|---|---|---|
void | connectTo |
Creates a uni-directional connection between this agent and a given
other agent.
|
void | copyFrom_xjal | |
void | deliver | |
boolean | disconnect() |
Disconnects this agent from another given agent.
|
void | doConnect_xjal |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons. |
void | doDisconnect_xjal |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons. |
double | getArrowLocation() | |
LineArrowStyle | getArrowStyle() | |
AbstractLinkToAgent<A, | getBidirectionalPeer_xjal |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons. |
T | getConnectedAgent() |
Returns connected agent
|
Color | getLineColor() | |
LineStyle | getLineStyle() | |
double | getLineWidth() | |
LinkToAgentAnimationSettings | getLinkToAgentCommonAnimationSettings() |
Returns link animation settings shared by the all the agents having this link.
Changes to these settings apply to drawing of all links of this type |
LinkToAgentAnimationSettings | getLinkToAgentMyAnimationSettings() |
Returns link animation settings for this particular agent.
Changes to these settings apply to drawing of this link only inside its agent |
A | getOwner() | |
boolean | isConnected() |
Tests if this link is connected to some agent.
|
boolean | isDeliverToAgent_xjal() |
Override this function for agent links which should call agent's "On Receive" code
(which is defined in a standard 'connections' link).
|
boolean | isVisible() | |
void | onDestroy() |
Discards the link and disconnects it if it is bidirectional.
|
void | onDestroy | |
void | onReceive |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons. Override for custom on receive action |
void | send |
Sends a message to connected agent.
|
void | setArrowLocation | |
void | setArrowStyle | |
void | setLineColor | |
void | setLineStyle | |
void | setLineWidth | |
void | setVisible |
public LinkToAgentImpl(A owner, LinkToAgentAnimationSettings commonAnimationSettings)
public T getConnectedAgent()
Description copied from interface:
LinkToAgentReturns connected agent
- Specified by:
getConnectedAgentin interfaceLinkToAgent<T extends Agent,A extends Agent> - Returns:
- connected agent or
nullif this link isn't connected
public boolean isConnected()
Description copied from interface:
LinkToAgentTests if this link is connected to some agent.
- Specified by:
isConnectedin interfaceLinkToAgent<T extends Agent,A extends Agent> - Returns:
trueif the link is connected,falseotherwise- See Also:
@AnyLogicInternalAPI public void doConnect_xjal(T a)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.
it may be removed/renamed in future. It is public due to technical reasons.
- Specified by:
doConnect_xjalin interfaceAbstractLinkToAgent<T extends Agent,A extends Agent>
@AnyLogicInternalAPI public void doDisconnect_xjal(T a)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.
it may be removed/renamed in future. It is public due to technical reasons.
- Specified by:
doDisconnect_xjalin interfaceAbstractLinkToAgent<T extends Agent,A extends Agent>
@AnyLogicInternalCodegenAPI public void onReceive(Object msg, Agent sender)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.
Override for custom on receive action
it may be removed/renamed in future. It is public due to technical reasons.
Override for custom on receive action
public void connectTo(T a)
Description copied from interface:
LinkToAgentCreates 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.
public boolean disconnect()
Description copied from interface:
LinkToAgentDisconnects this agent from another given agent.
- Specified by:
disconnectin interfaceLinkToAgent<T extends Agent,A extends Agent> - Returns:
trueif the agents were connected,falseotherwise
public void send(Object msg)
Description copied from interface:
LinkToAgentSends a message to connected agent. The message will be delivered during
a separate event scheduled to occur in zero time after the current one.
public void deliver(Object msg)
@AnyLogicInternalCodegenAPI public AbstractLinkToAgent<A,T> getBidirectionalPeer_xjal(T agent)
Description copied from interface:
AbstractLinkToAgentThis method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.
it may be removed/renamed in future. It is public due to technical reasons.
- Specified by:
getBidirectionalPeer_xjalin interfaceAbstractLinkToAgent<T extends Agent,A extends Agent>
public A getOwner()
@AnyLogicInternalCodegenAPI public void onDestroy()
Description copied from interface:
AbstractLinkToAgentDiscards the link and disconnects it if it is bidirectional.
Must be called when the agent is destroyed.
@AnyLogicInternalAPI public void onDestroy(Agent agent)
- Specified by:
onDestroyin interfaceAgentDestroyListener
public LinkToAgentAnimationSettings getLinkToAgentCommonAnimationSettings()
Description copied from interface:
AbstractLinkToAgentReturns link animation settings shared by the all the agents having this link.
Changes to these settings apply to drawing of all links of this type
Changes to these settings apply to drawing of all links of this type
- Specified by:
getLinkToAgentCommonAnimationSettingsin interfaceAbstractLinkToAgent<T extends Agent,A extends Agent> - Specified by:
getLinkToAgentCommonAnimationSettingsin interfaceLinkToAgentAnimationSettings- Returns:
- shared link animation settings
public LinkToAgentAnimationSettings getLinkToAgentMyAnimationSettings()
Description copied from interface:
AbstractLinkToAgentReturns link animation settings for this particular agent.
Changes to these settings apply to drawing of this link only inside its agent
Changes to these settings apply to drawing of this link only inside its agent
- Specified by:
getLinkToAgentMyAnimationSettingsin interfaceAbstractLinkToAgent<T extends Agent,A extends Agent> - Returns:
- link animation settings for this particular agent
@AnyLogicInternalCodegenAPI public boolean isDeliverToAgent_xjal()
Override this function for agent links which should call agent's "On Receive" code
(which is defined in a standard 'connections' link). Default implementation
returns
false- Specified by:
isDeliverToAgent_xjalin interfaceAbstractLinkToAgent<T extends Agent,A extends Agent> - Returns:
- call agent's "On Receive" code or not
@AnyLogicInternalAPI public boolean isVisible()
- Specified by:
isVisiblein interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setVisible(boolean visible)
- Specified by:
setVisiblein interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public Color getLineColor()
- Specified by:
getLineColorin interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setLineColor(Color lineColor)
- Specified by:
setLineColorin interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public double getLineWidth()
- Specified by:
getLineWidthin interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setLineWidth(double lineWidth)
- Specified by:
setLineWidthin interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public LineStyle getLineStyle()
- Specified by:
getLineStylein interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setLineStyle(LineStyle lineStyle)
- Specified by:
setLineStylein interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public LineArrowStyle getArrowStyle()
- Specified by:
getArrowStylein interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setArrowStyle(LineArrowStyle arrowStyle)
- Specified by:
setArrowStylein interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public double getArrowLocation()
- Specified by:
getArrowLocationin interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setArrowLocation(double arrowLocation)
- Specified by:
setArrowLocationin interfaceLinkToAgentAnimationSettings
@AnyLogicInternalAPI public void copyFrom_xjal(LinkToAgentAnimationSettings linkToAgentMyAnimationSettings)
- Specified by:
copyFrom_xjalin interfaceLinkToAgentAnimationSettings