- java.lang.Object
- com.anylogic.engine.Port<InMessageType,
- com.anylogic.engine.FlowchartPort<InMessageType,
- com.anylogic.engine.FlowchartMappedPort<InMessageType,
- Type Parameters:
InMessageType
- the type of messages being received by the portOutMessageType
- the type of messages being sent by the port
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Serializable
public class FlowchartMappedPort<InMessageType,OutMessageType> extends FlowchartPort<InMessageType,OutMessageType>
An implementation of
Usage: create a custom port of this type and add connector from this port to the port of embedded object (or call
There should be one and only one mapped port, otherwise an error will be thrown.
FlowchartPort
which delegates its count()
and isError()
methods to another port, this one is mapped with.Usage: create a custom port of this type and add connector from this port to the port of embedded object (or call
map(Port)
on this port).There should be one and only one mapped port, otherwise an error will be thrown.
- Since:
- 7.0
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
-
FlowchartPort
Port
Serialized Form
Constructor | Description |
---|---|
FlowchartMappedPort |
Modifier and Type | Method | Description |
---|---|---|
long | count() |
Returns the number of agents passed through this port so far
|
void | disconnectAndUnmapAll() |
Disconnects and unmaps the port from all ports and statechart it is
connected and/or mapped to.
|
boolean | isCannotAccept() |
Returns
true if this (input) port can't accept agents at the current time. |
boolean | isError() |
Returns
true if there is an error with this port,
e.g. |
boolean | isReadyToExit() |
Returns
true if there is some agent ready to exit this (output) port. |
void | map |
Maps (connects) the port to a port of an embedded object.
|
void | markError() |
Marks this port as having error
|
void | unmap |
Unmaps (disconnects) the port from a port of an embedded object.
|
getAgent, getFlowchartBlockRepresentative, getFlowchartBlockRepresentative, isPortStateAnimated, toString
public FlowchartMappedPort(FlowchartBlock ao)
public void map(Port<InMessageType, OutMessageType> port)
Description copied from class:
Port
Maps (connects) the port to a port of an embedded object.
send(msg) called on another port will result in send(msg) called on this port
and receive(msg) called on this port will result in receive(msg) called on
another port.
- Overrides:
map
in classPort<InMessageType,
OutMessageType> - Parameters:
port
- port of an embedded object
public void unmap(Port<InMessageType, OutMessageType> port)
Description copied from class:
Port
Unmaps (disconnects) the port from a port of an embedded object.
- Overrides:
unmap
in classPort<InMessageType,
OutMessageType> - Parameters:
port
- port of an embedded object
public void disconnectAndUnmapAll()
Description copied from class:
Port
Disconnects and unmaps the port from all ports and statechart it is
connected and/or mapped to.
- Overrides:
disconnectAndUnmapAll
in classPort<InMessageType,
OutMessageType>
public void markError()
Marks this port as having error
- Specified by:
markError
in classFlowchartPort<InMessageType,
OutMessageType> - Throws:
NullPointerException
- if this port has no mapped port
public boolean isError()
Description copied from class:
FlowchartPort
Returns
true
if there is an error with this port,
e.g. "the agent at the head of the queue has spent a non-zero
time at this port".- Specified by:
isError
in classFlowchartPort<InMessageType,
OutMessageType> - Returns:
true
if there is an error with this port- Throws:
NullPointerException
- if this port has no mapped port- See Also:
-
FlowchartPort.isError()
public boolean isCannotAccept()
Description copied from class:
FlowchartPort
Returns
true
if this (input) port can't accept agents at the current time.- Overrides:
isCannotAccept
in classFlowchartPort<InMessageType,
OutMessageType> - Throws:
NullPointerException
- if this port has no mapped port- See Also:
-
FlowchartPort.isCannotAccept()
public boolean isReadyToExit()
Description copied from class:
FlowchartPort
Returns
true
if there is some agent ready to exit this (output) port.- Overrides:
isReadyToExit
in classFlowchartPort<InMessageType,
OutMessageType> - Throws:
NullPointerException
- if this port has no mapped port- See Also:
-
FlowchartPort.isReadyToExit()
public long count()
Description copied from class:
FlowchartPort
Returns the number of agents passed through this port so far
- Specified by:
count
in classFlowchartPort<InMessageType,
OutMessageType> - Returns:
- the number of agents passed through this port so far
- Throws:
NullPointerException
- if this port has no mapped port- See Also:
-
FlowchartPort.count()