Skip to content

Conversation

@debog
Copy link
Collaborator

@debog debog commented Dec 2, 2025

Summary

This PR reorganizes the src directory into logical subdirectories and updates the CMake build system to automatically discover and compile source files. It also renames Utils.H/cpp to RuntimeParams.H/cpp for better clarity.

Directory Structure

Source files have been organized into 6 subdirectories:

  • agents/ - Agent containers and core agent definitions (3 files)
  • disease/ - Disease modeling components (5 files: parameters, status, hospital model, disease coupling)
  • init/ - Initialization and runtime parameters (13 files)
    • census/ - Census data loading and processing
    • infections/ - Initial infection setup and case data
    • urbanpop/ - Urban population data structures
    • RuntimeParams.H/cpp - Runtime parameter management
  • interactions/ - All interaction models (8 files: home, school, work, neighborhoods, air travel)
  • io/ - Input/output operations (2 files)
  • travel/ - Air travel flow data and logic (2 files)

CMake Build System Improvements

The CMake build system has been enhanced to:

  • Automatically discover all subdirectories in src/
  • Automatically detect and compile all .cpp and .H files in each subdirectory
  • Eliminate the need for manual file listing in CMakeLists.txt
  • Support adding new files or subdirectories without CMake configuration changes

File Renaming and Reorganization

  • Renamed Utils.H/cpp to RuntimeParams.H/cpp for better clarity
  • Moved RuntimeParams files from utils/ to init/ directory
  • Removed empty utils/ directory
  • Updated all include statements throughout the codebase (7 files)
  • Updated header guard from UTILS_H_ to RUNTIME_PARAMS_H_
  • Updated documentation comments

Changes

  • 33 files reorganized into subdirectories (using git mv to preserve history)
  • Utils.H/cpp renamed to RuntimeParams.H/cpp with all references updated
  • RuntimeParams files moved to init/ directory
  • src/CMakeLists.txt simplified from 42 lines to 30 lines
  • Build verified to work correctly with all files compiled

Test plan

  • CMake configuration succeeds
  • Full build completes successfully
  • All source files (11 .cpp files + headers) are compiled
  • Executable links correctly
  • All include statements reference correct file names

🤖 Generated with Claude Code

…ection

- Organized source files into logical subdirectories:
  - agents/: Agent containers and definitions
  - data/: Data loading and processing
  - disease/: Disease modeling components
  - interactions/: All interaction models
  - io/: Input/output operations
  - utils/: Utility functions
- Updated CMake build system to automatically discover and compile files from subdirectories
- No manual file listing required - new files and directories are automatically included in the build

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
debog and others added 5 commits December 1, 2025 19:31
- Renamed src/utils/Utils.H to RuntimeParams.H
- Renamed src/utils/Utils.cpp to RuntimeParams.cpp
- Updated all #include statements throughout the codebase (7 files)
- Updated header guard from UTILS_H_ to RUNTIME_PARAMS_H_
- Updated file documentation comments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…ectory

- Moved src/utils/RuntimeParams.H to src/init/RuntimeParams.H
- Moved src/utils/RuntimeParams.cpp to src/init/RuntimeParams.cpp
- Removed empty src/utils directory
- No include statement changes needed due to CMake's automatic include path handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
RuntimeParams.H should come before UrbanPopData.H in alphabetical order.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Template class constructors and destructors should not repeat template
parameters in their declarations. This was causing compilation errors
with certain C++ compilers.

Fixed in:
- InteractionModel.H: Removed template parameters from constructor/destructor
- DiseaseStatus.H: Removed template parameters from constructor/destructor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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