Comments (4)
Needs to have assertion errors to stop users from allowing agents to create messages outside of the bounds of the message environment. Will be integrated in version 2.
from flamegpu.
Snip
Neither XLST or C preprocessor macro's support (clean) floating point arithmetic, so it isn't easily feasible to check this is correct at compile time (I just hacked together a quick solution using pre-processor integer arithmetic, before noticing floating point values have been used within the examples).
Presumably such a check would therefore need to be included within the initialisation function of current FLAMEGPU, this is less desirable, but I don't see a solution for warning about this earlier. It might be possible to achieve this with XLSTs limited mathematical operations, however I'm unsure whether FLAMEGPUs packaged xlst preprocessor supports these and where I can find clear documentation on their usage.
from flamegpu.
Managed to get XLST math to work correctly with alot of trial and error (removing the //
or space before -
seemingly breaks this code), will test examples still build and commit.
<!--Compile time error if partitioning radius is not a factor of the partitioning dimensions as this causes partioning to execute incorrectly-->
<xsl:for-each select="gpu:xmodel/xmml:messages/gpu:message/gpu:partitioningSpatial">
<xsl:if test="(//gpu:xmax - //gpu:xmin) != (floor((//gpu:xmax - //gpu:xmin ) div //gpu:radius ) * //gpu:radius)">
#error "Partitioning radius must be a factor of partitioning dimensions.\nRadius: <xsl:value-of select="gpu:radius"/>, Xmin: <xsl:value-of select="gpu:xmin"/>, Xmax: <xsl:value-of select="gpu:xmax"/>"
</xsl:if><xsl:if test="(//gpu:ymax - //gpu:ymin) != (floor((//gpu:ymax - //gpu:ymin ) div //gpu:radius ) * //gpu:radius)">
#error "Partitioning radius must be a factor of partitioning dimensions.\nRadius: <xsl:value-of select="gpu:radius"/>, Ymin: <xsl:value-of select="gpu:ymin"/>, Ymax: <xsl:value-of select="gpu:ymax"/>"
</xsl:if><xsl:if test="(//gpu:zmax - //gpu:zmin) != (floor((//gpu:zmax - //gpu:zmin ) div //gpu:radius ) * //gpu:radius)">
#error "Partitioning radius must be a factor of partitioning dimensions.\nRadius: <xsl:value-of select="gpu:radius"/>, Zmin: <xsl:value-of select="gpu:zmin"/>, Zmax: <xsl:value-of select="gpu:zmax"/>"
</xsl:if>
</xsl:for-each>
from flamegpu.
Just updated the fix for this (and overwrote the prev fix). Discussion with Paul clarified that //
notation searches from the root, meaning the above fix could work incorrectly where multiple spatial partitions exist.
I tested it again without the slashes, and the earlier error seems to have disappeared, so presumably I fixed whatever was causing that (potentially incorrect division, although that would mean it doesn't parse L2R) whilst arranging the rest of the algorithm.
from flamegpu.
Related Issues (20)
- Is it possible to make a continuous environment with cyclic features? HOT 2
- NVTX range errors for Init
- GLM in VS 2019 with CUDA 10.1 HOT 7
- CI Builds HOT 1
- Predator prey model - cannot include grass HOT 2
- Visual Studio Solution/Props file support for submodules
- CUDA 10 / SM75 Makefile support
- CUDA 11.0
- CUDA 11 Deprecations
- Stable Marriage Out of Bounds Access
- accessing the values of an array variable HOT 2
- Problems encountered when using FLAME GPU HOT 6
- Is there any way to update agent information or global variables through other files at runtime? HOT 2
- Failed to set the environment variable array in Step Functions HOT 1
- Approaches to call python functions in the StepFunction of FLAMEGPU HOT 2
- XSLT bug generating more than 9 streams.
- Bug: `h_add_agents_` does not correctly detect buffer size exceeding in some cases
- Add a new agent type to the custom visualisation HOT 2
- Linking other static libraries in makefile under Linux
- Problems in running visual mode on Ubuntu HOT 1
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 flamegpu.