Comments (5)
from docs.
I have an example of a 4 x 4 x 4 world, with 16 discrete and 16 continuous agents.
The agents are arranged in a grid on the 0 Z plane, at (0,0), (0, 1), etc.
With radius 1 discrete messaging, all agents read 8 discrete messages - it must wrap (and ignores itself).
With spatially partitioned messaging with a radius 1, all agents read 9 messages, including those at the edge.
With spatially partitioned messaging with a radius 4 (i.e 1 bin), all agents read 144 messages (16 * 9).
All agents are in bounds, although I have not checked bin counts manually.
from docs.
Check whether the generated code matches that I posted above. If it hasn't been changed, it's not technically wrapping or clamping, it's a mish mash inbetween and should be declared undefined behaviour.
Proper wrapping would require use of the modulo operator. And as the C modulo operator doesn't act as a continuous function across 0 (it instead mirrors), you would need to then do further arithmetic of GridDim - (partitionDim%GridDim) if partitionDim began as <0 (iirc).
from docs.
The generated code is the same as above.
For the reading of messages in spatially partitoned messaging where only the moores neighbourhood is considered this is correctly wrapping.
Writing out of the environment bounds is clamped to the bin, but writing out of bounds is effectively undefined behaviour - it shouldn't really be happening.
Discrete messages are wrapped via
#define sWRAP(x,m) (((x)<m)?(((x)<0)?(m+(x)):(x)):(m-(x))) /**<signed integer wrap (no modulus) for negatives where 2m > |x| > m */
Which looks like it should be fine for all sensible radii values. Not sensible values (ie. a radius larger than the environment) is effectively an invalid configuration and is undefined / should be not allowed realistically.
from docs.
Spatially Partitioned Messaging
- Document that spatial partitioning must result in environments of > 3 bins in the X and Y dimensions or an error will occur
- In this case the user should just use brute-force messaging
- Document that spatially partitioned messages wrap in the X,Y dimensions to form a torus
- Document that outputting a spatially partitioned message outside of the environment bounds is undefined behaviour.
- This is currently clamped but this should not be relied upon.
Discrete Partitioned Messages
- Document that radii should be less than or equal to
floor((width - 1) / 2)
- to avoid reading the same message multiple times, where width is thesqrt(bufferSize)
- Document that messages wrap in the X Y dimensions, forming a torus.
- Document that outputting a message with X Y dimensions out of range is undefined behaviour.
from docs.
Related Issues (20)
- Current RTD builds failing HOT 2
- Host access of agent variables (1.5)
- min and max analytics functions HOT 1
- Agent Type and Message Partitioning Table (or list) HOT 1
- Quircks of Discrete Messaging with Different Radii HOT 1
- Parameter Exploration Example HOT 2
- Add tags to the docs for versioning HOT 1
- Graph based communication
- RTD Badge HOT 1
- Document early_exit functions HOT 1
- Document Agent ID Generation when merged
- RNG
- Document message partitioning technique macro HOT 1
- Document accessing agent array data.
- Various Updates for 1.5 HOT 3
- Example Creation documentation HOT 1
- Document Updated Command Line Arguments HOT 2
- Vector and Unsigned Types HOT 2
- LaTeX commands leftover from old version of docs.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.