LCAV/pyroomacoustics

[Question] Why ray-tracing results are inconsistent?

z-wony opened this issue · 2 comments

z-wony commented

Hi.

First of all, I'd like to make sure that it is not a complain, I just want to get an advice about it.

When I tested room simulation with hybrid approach (ISM + ray tracing),
I got different result every time although every parameters and source files are same.

I tested below example.
https://pyroomacoustics.readthedocs.io/en/pypi-release/pyroomacoustics.room.html#hybrid-ism-ray-tracing-simulator

room = pra.ShoeBox(
    room_dim,
    fs=16000,
    materials=pra.Material(e_absorption),
    max_order=3,
    ray_tracing=True,
    air_absorption=True,
)

If I use ISM simulator, every results are perfectly same. (It is good)
But I wonder why 'ray tracing' makes inconsistent result.
Could you let me advice which feature or code affects consistency? (or any hint is welcome)
If I can find reason and if it is bug, I will try to fix it.

Thanks.

Hello @z-wony , what you are observing is actually expected! The ray-tracing is a stochastic method. If you need to have deterministic or reproducible results, you should set the seed of the random number generator.

z-wony commented

Thank you for answer!
I understand the reason, and also tested with static seed.