Currently i have created 2D array containing neighbor information in one of the agents. I want this array to be global so that other agents can also access this array and update the information in the array. Please tell how to make a data structure or a variable global so others agents can also access that.
How to make data structure global in unetstack so that multiple agents can update information in that data structure?
114 Views Asked by kumars45 At
1
There are 1 best solutions below
Related Questions in UNETSTACK
- Is there a way to supply bathymetry to the custom channel?
- How to write Modem Drivers for non-subnero modems?
- Setting physical channel parameters from an agent
- How do i record JANUS signal as wav file?
- Native library `yoda_phy_pa_x86_64` not found while installing Unet audio in macOS
- Calculating Dropped Packet using trace.json for a simulation in UnetStack3
- How to connect two computers using unet audio?
- How to make data structure global in unetstack so that multiple agents can update information in that data structure?
- How to dynamically calculate path for Node (USV) for connected 2-UAV which are surveying in orthogonal lawnmower pattern in simulation?
- Creating a communication between client and server node in unetstack using UnetSocket
- Creating multiple UnetSockets in UnetStack to exhaust the server
- Unetstack C API with Unetsim simulator
- UnetStack - Routing Protocols
- Adding a new node in the topology after the given time interval
- encountering an error while running the simulation for SlottedFama in Unet IDE
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
In a distributed system, agents can, in theory, run on different containers and even different machines, and hence sharing a data structure or array isn't a good idea.
Having said that, if you knew that the agents accessing the data structure were guaranteed to be running in the same container, you could share a reference to the data structure between agents and manipulate/access the data from different agents. The reference may be shared during setup of the stack when the agents are constructed, by providing getters/setters where the reference could be obtained and passed to other agents. If you did this, you'd also need to ensure synchronization, as each agent runs in its own thread, and you could have data races. Although this is easily doable, I would strongly advise against this approach.
A better approach would be to send messages between agents to get/update the shared information, or expose the shared information as agent parameters. For example, the
NodeInfoagent does exactly this, by exposing commonly needed information (e.g. node address, node location, node orientation, etc) about a node as parameters that many other agents access and a few update.