5/31/2023 0 Comments Message passing in anylogicIn that code you can use a local variable msg, which is a reference of type Object to a just sent message. This code is executed each time a message is sent. You can define the message reception handler in the On receive action code property of the port. These rules are illustrated graphically in Figure 76. The method receive() of the port is called and the code specified in the port On receive action code property is executed (see section 7.1.7.1, “Defining message reception handler” for more details). The message received at a port with a queue is placed in the queue as well. Otherwise, if a message arrives to a public port from the outside or if it arrives to a private port, the message is received by a port and processed further according to the message routing rules, described in section 7.1.5, “Message routing rules”. In this case the method send() of the port is called and the code specified in the On send action code property of the port is executed (see section 7.1.6.3, “Defining message sending handler” for more details). If a message arrives at a public port from an internal port (from a private port or a port of an encapsulated object), the public port acts as a relay port and sends the message further along the external connections of the public port. In the case of a private port it is forwarded to all connected ports.Īrrived message processing at a port also depends on the type of a port.In the case of a public port, the message is forwarded along all the port connections outside the active object.The way the sent message is processed further depends on the type of the port: When you send a message via a port, it is processed further.
0 Comments
Leave a Reply. |