SlideShare a Scribd company logo
1 of 16
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

Viewers also liked

9. model pembelajaran saintifik mp bhs indonesia
9. model pembelajaran saintifik mp bhs indonesia9. model pembelajaran saintifik mp bhs indonesia
9. model pembelajaran saintifik mp bhs indonesiaadulcharli
 
Capturar claus amb Wireshark o la sobre importància del xifrat
Capturar claus amb Wireshark o la sobre importància del xifratCapturar claus amb Wireshark o la sobre importància del xifrat
Capturar claus amb Wireshark o la sobre importància del xifratJordi Clopés Esteban
 
Badminton VOCABULARI
Badminton VOCABULARIBadminton VOCABULARI
Badminton VOCABULARIccidt
 
2006 este general
2006 este general2006 este general
2006 este generalAnam
 
Grocery Shopping at Fry's
Grocery Shopping at Fry'sGrocery Shopping at Fry's
Grocery Shopping at Fry'sshenny06
 
presentacion 1
presentacion 1presentacion 1
presentacion 1jrr1973
 
Workshop: Betere conversie met online leads
Workshop: Betere conversie met online leadsWorkshop: Betere conversie met online leads
Workshop: Betere conversie met online leadsPaul de Vries
 
Ananth - Holistic test suite development and Twist
Ananth - Holistic test suite development and TwistAnanth - Holistic test suite development and Twist
Ananth - Holistic test suite development and TwistvodQA
 
Encuesta
EncuestaEncuesta
Encuestacinty
 
Risks and facts for the creation of online distribution structures - E-Busine...
Risks and facts for the creation of online distribution structures - E-Busine...Risks and facts for the creation of online distribution structures - E-Busine...
Risks and facts for the creation of online distribution structures - E-Busine...Bernd Zipper
 
Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12Anam
 

Viewers also liked (14)

9. model pembelajaran saintifik mp bhs indonesia
9. model pembelajaran saintifik mp bhs indonesia9. model pembelajaran saintifik mp bhs indonesia
9. model pembelajaran saintifik mp bhs indonesia
 
Capturar claus amb Wireshark o la sobre importància del xifrat
Capturar claus amb Wireshark o la sobre importància del xifratCapturar claus amb Wireshark o la sobre importància del xifrat
Capturar claus amb Wireshark o la sobre importància del xifrat
 
Badminton VOCABULARI
Badminton VOCABULARIBadminton VOCABULARI
Badminton VOCABULARI
 
2006 este general
2006 este general2006 este general
2006 este general
 
Grocery Shopping at Fry's
Grocery Shopping at Fry'sGrocery Shopping at Fry's
Grocery Shopping at Fry's
 
presentacion 1
presentacion 1presentacion 1
presentacion 1
 
Presentation3
Presentation3Presentation3
Presentation3
 
Workshop: Betere conversie met online leads
Workshop: Betere conversie met online leadsWorkshop: Betere conversie met online leads
Workshop: Betere conversie met online leads
 
36933005 scm4latest
36933005 scm4latest36933005 scm4latest
36933005 scm4latest
 
Ananth - Holistic test suite development and Twist
Ananth - Holistic test suite development and TwistAnanth - Holistic test suite development and Twist
Ananth - Holistic test suite development and Twist
 
Encuesta
EncuestaEncuesta
Encuesta
 
Risks and facts for the creation of online distribution structures - E-Busine...
Risks and facts for the creation of online distribution structures - E-Busine...Risks and facts for the creation of online distribution structures - E-Busine...
Risks and facts for the creation of online distribution structures - E-Busine...
 
Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12
 
Modul 1 bm2
Modul 1 bm2Modul 1 bm2
Modul 1 bm2
 

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

Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixAdrian Trenaman
 
Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Bhushan Mulmule
 
Xke - Introduction to Apache Camel
Xke - Introduction to Apache CamelXke - Introduction to Apache Camel
Xke - Introduction to Apache CamelAlexis Kinsella
 
Understanding COM+
Understanding COM+Understanding COM+
Understanding COM+Dudy Ali
 
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 ModulesToradex
 
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 HubKevin Hakanson
 
Tutorial_Python1.pdf
Tutorial_Python1.pdfTutorial_Python1.pdf
Tutorial_Python1.pdfMuzamilFaiz
 
TMForum Open:Hack - FIWARE Training Session
TMForum Open:Hack - FIWARE Training SessionTMForum Open:Hack - FIWARE Training Session
TMForum Open:Hack - FIWARE Training SessionAitor 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
 

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

Week8
Week8Week8
Week8
 
2. workload
2.  workload2.  workload
2. workload
 
I x scripting
I x scriptingI x scripting
I x scripting
 
Tutorial Solution
Tutorial SolutionTutorial Solution
Tutorial Solution
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMix
 
Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Xke - Introduction to Apache Camel
Xke - Introduction to Apache CamelXke - Introduction to Apache Camel
Xke - Introduction to Apache Camel
 
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...
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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.