SlideShare a Scribd company logo
How to send message by using
ports and connections
Become an AnyLogic Expert Step by Step
About me
khoi.tran@simbean.com 2
My name is Khoi Tran and I’m living in beautiful Stuttgart, Germany.
As a 12-years expert in the software industry and 6-years expert in
simulation with AnyLogic, I would like to share my experiences
with you on a simple and fast path.
Learning subjects
khoi.tran@simbean.com 3
In this example you can learn,
• Understand message passing mechanism with port
• Port connection: one to one
• Port connection: one to many
You can see the demo in action first
http://simbean.com/en/knowhow/become-an-anylogic-expert.html
If you like to know, how I built this model, this presentation may help you.
Simple messaging mechanism
khoi.tran@simbean.com 4
Active objects can exchange information in form of messages by using port
communication
• Messages can be moving objects e.g. vehicles, human-beings, animals in the
models
• With ports active objects can be connected and created a network
Active object Station
e.g. station A
Active object Station
e.g. station B
PortsPorts
Line as
connectionInformation e.g.
Object car
Car can be animated as moving object from station A to station B by message
passing using ports and its connections.
Simple message passing mechanism
khoi.tran@simbean.com 5
• Ports are bidirectional, ports can send and receive message
• Ports ob the same active object cannot be connected
Active object Station
e.g. station A
Active object Station
e.g. station B
Send message:
object car
Receive message:
object car
Active object
Parklot
e.g. Parklot 02
Active object
Parklot
e.g. Parklot 01
Simple message passing mechanism
khoi.tran@simbean.com 6
Message is forwarded to direct connected port
Active object Station
e.g. station A
Active object Station
e.g. station B
Receive message:
object car
Send message
e.g. Object car
Send message:
object car
Receive message:
object car
Create port in an active object
khoi.tran@simbean.com 7
Create active object
Station
Create a port by drag &
drop
Specify message type
khoi.tran@simbean.com 8
The variable of in coming
message is ”msg”. The
String message is shown on
the console, when the
message arrives
Message is of type String e.g., for
out going and in coming type
Message is of type String e.g., for
out going and in coming type
Connecting ports and send message
khoi.tran@simbean.com 9
On the Main active
object, we create two
ports and connect
them together
The String message “Car“ is sent by method call
activeObjectName.portName.send(“messageText“)
Result
khoi.tran@simbean.com 10
Event triggers the sending message
process at the station_A and station_B
received the message and show it on the
console
Forwarding message to embedded object
khoi.tran@simbean.com 11
String type for in comming and
out going message
Create an active object “ParkingLot” and create a port within this
active object
String type for in comming and
out going message
Show the message on the
console, when a “Car“ message
is arrived
Forwarding message to embedded object
khoi.tran@simbean.com 12
Connect the port with the port
of active object parking_lot
Create an active object “StationWithParkingLot” and create a port within this
active object, then create an embedded active object parking_lot
This station show the receiving message first, then
forward it to the parking_lot active object
Forwarding message to embedded object
khoi.tran@simbean.com 13
Message “Car “ is sent from
the station_A
One message can be sent to multiple receivers. This scenario can be
built on the main active object
Station_B receives the
message and show it on the
console
StationWithParkingLot
receives the message and
show it on the console, then
forward this message to its
embedded parking_lot
active object
Result
khoi.tran@simbean.com 14
1. First text line is the message from the station_B
2. Second text line is the message from stationWithParkingLot
3. Third text line is the message from embedded active object park_lot
inside active object stationWithParkingLot
Run the model
khoi.tran@simbean.com
Click on the run button and
choose the simulation
15
1. You can run the model and see the result
2. Try to change or set properties to see some small effects e.g.
1. Test the message with different message types
2. Create a chain active object stations for forwarding messages
3. You need to restart the model to see the effects
Thank You
khoi.tran@simbean.com 16
IF YOU HAVE ANY QUESTION, IDEA, FEEDBACK or FIND ANY MISTAKE,
PLEASE SEND ME an EMAIL
khoi.tran@simbean.com
BECAUSE I WOULD LIKE to IMPROVE this SLIDE CONTINUOUSLY.
I APPRECIATE a lot YOUR TIME.

More Related Content

Similar to AnyLogic - Free AnyLogic basic lessions - Learning AnyLogic by examples - Demo simpleMessagePassing

Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
Hoàng Hải Nguyễn
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
Mickaël Rémond
 
C++
C++C++
A First Date With Scala
A First Date With ScalaA First Date With Scala
A First Date With Scala
Franco Lombardo
 
Understanding COM+
Understanding COM+Understanding COM+
Understanding COM+
Dudy Ali
 
L9
L9L9
L9
lksoo
 
IoT Parking Lot Demo on Toradex Modules
IoT Parking Lot Demo on Toradex ModulesIoT Parking Lot Demo on Toradex Modules
IoT Parking Lot Demo on Toradex Modules
Toradex
 
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax HubImplementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
Kevin Hakanson
 
Intro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm ReviewIntro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm Review
Blue Elephant Consulting
 
Tutorial_Python1.pdf
Tutorial_Python1.pdfTutorial_Python1.pdf
Tutorial_Python1.pdf
MuzamilFaiz
 
TMForum Open:Hack - FIWARE Training Session
TMForum Open:Hack - FIWARE Training SessionTMForum Open:Hack - FIWARE Training Session
TMForum Open:Hack - FIWARE Training Session
Aitor Magán García
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
Andrey Karpov
 
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdfAssignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
fasttrackscardecors
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
Heather Dionne
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
Srushith Repakula
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
CodeOps Technologies LLP
 
JavaScript
JavaScriptJavaScript
JavaScript
Ivano Malavolta
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
Clint Edmonson
 

Similar to AnyLogic - Free AnyLogic basic lessions - Learning AnyLogic by examples - Demo simpleMessagePassing (18)

Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
C++
C++C++
C++
 
A First Date With Scala
A First Date With ScalaA First Date With Scala
A First Date With Scala
 
Understanding COM+
Understanding COM+Understanding COM+
Understanding COM+
 
L9
L9L9
L9
 
IoT Parking Lot Demo on Toradex Modules
IoT Parking Lot Demo on Toradex ModulesIoT Parking Lot Demo on Toradex Modules
IoT Parking Lot Demo on Toradex Modules
 
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax HubImplementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
 
Intro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm ReviewIntro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm Review
 
Tutorial_Python1.pdf
Tutorial_Python1.pdfTutorial_Python1.pdf
Tutorial_Python1.pdf
 
TMForum Open:Hack - FIWARE Training Session
TMForum Open:Hack - FIWARE Training SessionTMForum Open:Hack - FIWARE Training Session
TMForum Open:Hack - FIWARE Training Session
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
 
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdfAssignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
 
JavaScript
JavaScriptJavaScript
JavaScript
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
 

Recently uploaded

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 

Recently uploaded (20)

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 

AnyLogic - Free AnyLogic basic lessions - Learning AnyLogic by examples - Demo simpleMessagePassing

  • 1. How to send message by using ports and connections Become an AnyLogic Expert Step by Step
  • 2. About me khoi.tran@simbean.com 2 My name is Khoi Tran and I’m living in beautiful Stuttgart, Germany. As a 12-years expert in the software industry and 6-years expert in simulation with AnyLogic, I would like to share my experiences with you on a simple and fast path.
  • 3. Learning subjects khoi.tran@simbean.com 3 In this example you can learn, • Understand message passing mechanism with port • Port connection: one to one • Port connection: one to many You can see the demo in action first http://simbean.com/en/knowhow/become-an-anylogic-expert.html If you like to know, how I built this model, this presentation may help you.
  • 4. Simple messaging mechanism khoi.tran@simbean.com 4 Active objects can exchange information in form of messages by using port communication • Messages can be moving objects e.g. vehicles, human-beings, animals in the models • With ports active objects can be connected and created a network Active object Station e.g. station A Active object Station e.g. station B PortsPorts Line as connectionInformation e.g. Object car Car can be animated as moving object from station A to station B by message passing using ports and its connections.
  • 5. Simple message passing mechanism khoi.tran@simbean.com 5 • Ports are bidirectional, ports can send and receive message • Ports ob the same active object cannot be connected Active object Station e.g. station A Active object Station e.g. station B Send message: object car Receive message: object car
  • 6. Active object Parklot e.g. Parklot 02 Active object Parklot e.g. Parklot 01 Simple message passing mechanism khoi.tran@simbean.com 6 Message is forwarded to direct connected port Active object Station e.g. station A Active object Station e.g. station B Receive message: object car Send message e.g. Object car Send message: object car Receive message: object car
  • 7. Create port in an active object khoi.tran@simbean.com 7 Create active object Station Create a port by drag & drop
  • 8. Specify message type khoi.tran@simbean.com 8 The variable of in coming message is ”msg”. The String message is shown on the console, when the message arrives Message is of type String e.g., for out going and in coming type Message is of type String e.g., for out going and in coming type
  • 9. Connecting ports and send message khoi.tran@simbean.com 9 On the Main active object, we create two ports and connect them together The String message “Car“ is sent by method call activeObjectName.portName.send(“messageText“)
  • 10. Result khoi.tran@simbean.com 10 Event triggers the sending message process at the station_A and station_B received the message and show it on the console
  • 11. Forwarding message to embedded object khoi.tran@simbean.com 11 String type for in comming and out going message Create an active object “ParkingLot” and create a port within this active object String type for in comming and out going message Show the message on the console, when a “Car“ message is arrived
  • 12. Forwarding message to embedded object khoi.tran@simbean.com 12 Connect the port with the port of active object parking_lot Create an active object “StationWithParkingLot” and create a port within this active object, then create an embedded active object parking_lot This station show the receiving message first, then forward it to the parking_lot active object
  • 13. Forwarding message to embedded object khoi.tran@simbean.com 13 Message “Car “ is sent from the station_A One message can be sent to multiple receivers. This scenario can be built on the main active object Station_B receives the message and show it on the console StationWithParkingLot receives the message and show it on the console, then forward this message to its embedded parking_lot active object
  • 14. Result khoi.tran@simbean.com 14 1. First text line is the message from the station_B 2. Second text line is the message from stationWithParkingLot 3. Third text line is the message from embedded active object park_lot inside active object stationWithParkingLot
  • 15. Run the model khoi.tran@simbean.com Click on the run button and choose the simulation 15 1. You can run the model and see the result 2. Try to change or set properties to see some small effects e.g. 1. Test the message with different message types 2. Create a chain active object stations for forwarding messages 3. You need to restart the model to see the effects
  • 16. Thank You khoi.tran@simbean.com 16 IF YOU HAVE ANY QUESTION, IDEA, FEEDBACK or FIND ANY MISTAKE, PLEASE SEND ME an EMAIL khoi.tran@simbean.com BECAUSE I WOULD LIKE to IMPROVE this SLIDE CONTINUOUSLY. I APPRECIATE a lot YOUR TIME.