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?
51 views Asked by kumars45 At
1
There are 1 answers
Related Questions in UNETSTACK
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
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?
Popular Tags
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)
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
NodeInfo
agent 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.