Skip to content

Step by step approach to simulation added #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Step by step approach to simulation added #251

wants to merge 1 commit into from

Conversation

PeterTurcan
Copy link
Collaborator

Added an introduction to creating real-world simulations, pulling in Boost libraries where needed - starting with Boost.Chrono for timing, then asio, graph, geometry, units, serialization and others as needed or suggested for certain situations.

@cppalliance-bot
Copy link

An automated preview of the documentation is available at https://251.site-docs.prtest2.cppalliance.org/contributor-guide/index.html

Copy link
Member

@alandefreitas alandefreitas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we moved to C++11, it's worth considering which Boost libraries only exist for backward compatibility.

@@ -20,10 +24,365 @@ Creating a real-time simulation of vehicles involves various aspects, including

* boost:graph[]: In case you need to represent roads or pathways as a graph, this library provides a flexible and powerful way to represent and manipulate graphs. It also includes a number of graph algorithms.

* boost:thread[] or boost:asio[]: To achieve real-time performance, you might need to make use of multi-threading or asynchronous input/output. boost:thread[] provides classes and functions for multi-threading, synchronization, and inter-thread communication. boost:asio[] is a cross-platform library for asynchronous programming and can handle a lot of networking tasks as well.
* boost:thread[] or boost:asio[]: To achieve real-time performance, you might need to make use of multi-threading or asynchronous input/output. boost:thread[] provides classes and functions for multi-threading, synchronization, and inter-thread communication, and would be useful to parallelize calculations for physics updates. boost:asio[] is a cross-platform library for asynchronous programming and can handle a lot of networking tasks as well.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should keep talking about libraries like Boost.Thread in these contexts where we describe what makes Boost unique. This functionality has been available as std::thread in the standard library for 13 years, and I don't think Boost.Thread has received much maintenance or new features since then.


* boost:interprocess[]: If you need to share data between different processes in real-time, this library can be useful. It supports shared memory, memory-mapped files, semaphores, and more.

* boost:mpi[] or boost:asio[]: For distributed simulations that run across multiple systems, you might need a library for network communication. boost:mpi[] provides a pass:[C++] interface for the Message Passing Interface (MPI) standard for distributed computing. boost:asio[] can also handle networking tasks and it is a bit lower-level.

* boost:serialization[]: To save the state of the simulation or to communicate complex data structures over a network, you might find this library helpful.

* boost:random[]: It is often helpful to introduce "noise" in a simulation to mimic real-world unpredictability, such as initial conditions, changes to weather patterns, modelling uncertainty, and reducing complex computations to simple statistical chances.
Copy link
Member

@alandefreitas alandefreitas Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boost.Random and std's <random> are in the same situation as Boost.Thread and std::thread.


If needed, plan for a dedicated I/O handler that uses boost:asio[] for managing asynchronous operations.

=== Implement Timing Control with Boost.Chrono
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with Boost.Chrono and std::chrono.

@PeterTurcan
Copy link
Collaborator Author

Good feedback @alandefreitas thanks, closing this pending further research

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants