Skip to content

Add RegulatoryNetwork behavior with Boost ODE integration#471

Open
sportokalidis wants to merge 16 commits into
masterfrom
regulatory-network
Open

Add RegulatoryNetwork behavior with Boost ODE integration#471
sportokalidis wants to merge 16 commits into
masterfrom
regulatory-network

Conversation

@sportokalidis
Copy link
Copy Markdown
Contributor

This pull request introduces a new behavior class called RegulatoryNetwork that allows agents in a simulation to carry and evolve a system of ordinary differential equations (ODEs). The ODE integration is handled by the Boost.Numeric.Odeint library, which supports multiple numerical solvers including explicit Euler, Runge-Kutta, and Rosenbrock methods.

Boost is added as an optional dependency. If Boost is not found on the system, the build continues normally and the RegulatoryNetwork behavior is simply not available. The CI pipelines for Ubuntu and macOS are updated to install Boost so the feature is exercised during automated testing.

A demo called regulatory_networks is included and is accessible via:

bdm demo regulatory_networks

sportokalidis and others added 16 commits April 24, 2026 12:04
Add libboost-dev (Ubuntu) and boost (macOS) to package lists to support
Boost-based behaviors such as RegulatoryNetwork.
Introduce a 'boost' CMake option (ON by default) that finds Boost and
defines USE_BOOST. If Boost is not installed the option is silently
disabled with a warning, keeping the build fully backward-compatible.
Add an empty RegulatoryNetwork behavior class (stub) that subclasses
Behavior. The header is included in biodynamo.h only when USE_BOOST is
defined. Implementation of Run() is left for follow-up work.
rootcling (ROOT's dictionary generator) compiles headers independently
of the normal build, bypassing the USE_BOOST guard in biodynamo.h.
Wrapping the entire header content in #ifdef USE_BOOST makes the file
safe to process in any context when Boost is not present.
Add libboost-dev (Ubuntu) and boost (macOS) to the CI dependency
installation steps so RegulatoryNetwork builds correctly in CI.
__ROOTCLING__ is defined by both rootcling at compile time and by
Cling at runtime when it re-parses dictionary payloads. Boost headers
(odeint, phoenix) contain template machinery that breaks Cling's JIT
interpreter, corrupting the whole dictionary and causing unrelated
classes to fail. Guarding with #ifndef __ROOTCLING__ keeps the class
declaration visible for dictionary generation while hiding the
problematic Boost includes.
The header pulls in Boost includes which Cling (ROOT's JIT interpreter)
cannot resolve at runtime on macOS, breaking unrelated tests. As an
optional Boost-based behavior, it should not be auto-included. Users
include core/behavior/regulatory_network.h explicitly in their simulation
code when needed.
Exclude simulation output artifacts (CSV files and output directories)
from version control. These are generated at runtime and should not be
committed.
@vasvav vasvav requested a review from cayharris13 May 6, 2026 13:57
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.

2 participants