Skip to content

Added C# bindings through SWIG - #57

Open
bran-jnw wants to merge 6 commits into
firelab:masterfrom
bran-jnw:master
Open

bran-jnw wants to merge 6 commits into
firelab:masterfrom
bran-jnw:master

Conversation

@bran-jnw

@bran-jnw bran-jnw commented Nov 17, 2025 •

Copy link
Copy Markdown

Purpose

Hello, I am the developer of WUI-NITY (https://www.nfpa.org/education-and-research/research/fire-protection-research-foundation/projects-and-reports/wunity-a-platform-for-the-simulation-of-wildland-urban-interface-fire-evacuation) and am using Behave for spread rate calculations for various tasks.

I previously converted all of Behave into C# (a few years back) to make use of it, but it makes more sense to add C# bindings in order to keep up with any changes to Behave. As such I have used SWIG to create bindings and glue code, as well as adding a compile target for a DLL version of Behave.

If this is not in line with how you see Behave being used that's fine, just ignore and close the pull request, but I figured there might be someone else who might have similar needs (e.g. generate python bindings which just requires an additional config file).

Related Issues

No related issue

Submission Checklist

  • Code compiles are passing (make compile)
    It does compile, I had to fix safeSeperationDistanceCalculatior.cpp as that was not compiling from the latest commit.

  • Tests are passing (make test)
    Did not touch main code at all so did not run tests, but ran some tests of the generated DLL in a C# project and can generate FuelModels and run through
    doSurfaceRunInDirectionOfMaxSpread() for all 256 fuels (some of course come back with a 0).

Testing

@masonwillman

Copy link
Copy Markdown
Contributor

Hi @bran-jnw! Apologies for the extremely delayed response! I was only recently asked to watch this repo for activity and wanted to get back to you on this PR.

I think SWIG bindings are something we want to add to the Behave Library. However, rather than add the generate C# files directly, I think it makes more sense to add instructions on how to generate them.

My proposed changes for the PR would be as follows:

  • Remove the generated C# files from the PR (include them in the .gitignore as well)
  • Include a README that explains how to generate the files from the SWIG interface file

Let me know if that would be possible! Otherwise, we could handle these steps when we are ready to merge the PR.

@masonwillman
masonwillman self-requested a review October 28, 2026 21:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants