Skip to content
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

[Bug]:The results simulated by using Python Agent API in Tutorial Code are different from those using c++ Agent API. #1158

Closed
chenyuyou opened this issue Dec 9, 2023 · 10 comments

Comments

@chenyuyou
Copy link

Bug Description

The results simulated by using Python Agent API in Tutorial Code are different from those using c++ Agent API.
https://docs.flamegpu.com/tutorial/index.html#complete-tutorial-code

To Reproduce

image
This is the result by using python agent api
image
This is the result by using C++ agent api

Expected Behaviour

I think that the result of by using python agent api is wrong.

OS

win11

CUDA Versions

cuda 11

GPUs

3080

GPU Driver

No response

Additional Information

No response

@Robadob
Copy link
Member

Robadob commented Dec 9, 2023

I have a feeling this is a bug I've seen before and thought I addressed. Will take a look later this afternoon.

Thanks for reporting.

@Robadob
Copy link
Member

Robadob commented Dec 9, 2023

Hi,

I've tried both the "Python (using C++ Agent API)" and "Python (using Python Agent API)" versions found here and the both produce output like this (which is correct):

image

Is it possible you've modified one of the environment properties or made a mistake whilst copying from the individual code snippets?

Behaviour similar to your first screenshot can be achieved by setting repulse to a negative number.

image

If you can share your implementation I will try running that too.

@Robadob Robadob added the on hold label Dec 9, 2023
@chenyuyou
Copy link
Author

chenyuyou commented Dec 10, 2023

I completely copy the code of python style here and run. The result is not different than before.

And I rewrite those code in my repositories. Their codes are the same but the results are different.
The python code is https://github.com/chenyuyou/fg2-example/blob/main/circles_spatial2D/python/model.py
The c++ code is https://github.com/chenyuyou/fg2-example/blob/main/circles_spatial2D/python_rtc/model.py

@Robadob
Copy link
Member

Robadob commented Dec 10, 2023

I've just downloaded and ran both of your versions of the code. Both execute and produce the correct circle arrangement of agents after around 200 steps.

I don't think this would be a difference with the version of pyflamegpu you are using (I just built the latest from master), is it possible you have changes that you haven't pushed to git (e.g. check git diff)?

@chenyuyou
Copy link
Author

I've just downloaded and ran both of your versions of the code. Both execute and produce the correct circle arrangement of agents after around 200 steps.

I don't think this would be a difference with the version of pyflamegpu you are using (I just built the latest from master), is it possible you have changes that you haven't pushed to git (e.g. check git diff)?

How to build pyflamegpu lastest version?

@Robadob
Copy link
Member

Robadob commented Dec 10, 2023

How to build pyflamegpu lastest version?

Clone the git repo (or download the latest zip)

Then follow this guide from the docs.

@Robadob
Copy link
Member

Robadob commented Dec 10, 2023

Ah, this PR was merged a while back but isn't currently in a release. I expect that may explain your problem.

#1077

Apologies, for not realising sooner.

Edit: I reverted that commit locally, and it produced the behaviour you are seeing.

image

@Robadob
Copy link
Member

Robadob commented Dec 10, 2023

We're hoping to get another release out "soon", once #1090 #1089 and #1150 have been merged (the latter is waiting on a 3rd party PR to be merged [which itself is waiting on two other PRs]). This will hopefully be Jan/Feb.

I can manually trigger a draft release build, which will generate new wheels (that expire after ~24h) if you are unable to build pyflamegpu yourself.

@chenyuyou
Copy link
Author

How to build pyflamegpu lastest version?

Clone the git repo (or download the latest zip)

Then follow this guide from the docs.

Thanks for your help, I will try soon.

@Robadob Robadob closed this as completed Dec 12, 2023
@chenyuyou
Copy link
Author

Install pyflamegpu 2.0.0rc1+cuda118 wheel into D:/Downloads/FLAMEGPU2/build/lib/Release/python/venv
Looking in links: dist
EXEC : error : Could not find a version that satisfies the requirement pyflamegpu==2.0.0rc1+cuda118 (from versions: non
e) [D:\Downloads\FLAMEGPU2\build\swig\python\pyflamegpu.vcxproj]
EXEC : error : No matching distribution found for pyflamegpu==2.0.0rc1+cuda118 [D:\Downloads\FLAMEGPU2\build\swig\pytho
n\pyflamegpu.vcxproj]

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

No branches or pull requests

2 participants