This commit introduces a major enhancement to the heart simulation, adding a detailed mechanical model of the cardiac cycle that is synchronized with the existing EKG waveform.
Key features:
- The Heart class is refactored to include data structures for the four chambers (atria and ventricles) and four valves (mitral, tricuspid, aortic, pulmonary).
- The `update` method now simulates the phases of the cardiac cycle, including atrial and ventricular systole and diastole.
- Chamber pressures and volumes are dynamically updated based on the phase of the cycle.
- Valve statuses (open/closed) are determined by pressure gradients between chambers.
- Ejection Fraction is now calculated based on the simulated end-diastolic and end-systolic volumes of the left ventricle.
- The example program has been updated to display a live, detailed summary of the heart's mechanical status, showing pressures, volumes, and valve states as they change over time.
- Adds `getOrganSummary` and `getPatientSummary` to retrieve human-readable string summaries of organ vitals.
- Adds a templated function `getOrgan<T>` which allows for type-safe, direct access to specific organ objects. This enables calling organ-specific methods to retrieve raw data values (e.g., `heart->getHeartRate()`).
The example `main.cpp` has been updated to demonstrate the usage of all new functions.
This commit significantly expands the patient simulation by adding models
for the full digestive and urinary systems, as well as the spleen and
spinal cord.
This builds on the polymorphic organ framework by adding 9 new organ
classes:
- Kidneys
- Bladder
- Stomach
- Intestines
- Gallbladder
- Pancreas
- Esophagus
- Spleen
- SpinalCord
Each new organ has its own header, a source file with simplified
simulation logic for its unique physiological properties, and is
integrated into the main patient model and simulation loop.
The build system and example application have been updated to include
and demonstrate this new, more comprehensive set of organs.
This commit introduces Doxygen for documentation generation and a Gitea
workflow for continuous integration.
- Adds a `Doxyfile` to configure Doxygen to build a documentation
website with diagrams.
- Updates `AGENTS.md` to require Doxygen-compatible comments for all
code.
- Adds Doxygen comments to existing C++ source files to comply with
the new standard.
- Creates a Gitea workflow (`.gitea/workflows/build.yml`) that:
- Builds the project on every push.
- Generates Doxygen documentation.
- Uploads the compiled library and the documentation website as
artifacts.
- Broke out the Patient struct and its related functions (initializePatient, updatePatient) into their own files (Patient.h, Patient.cpp) for better organization.
- Implemented the initial UpdateState logic in the updatePatient function using a mean-reverting model. This ensures that vital signs fluctuate realistically around a healthy baseline.
- Updated CMakeLists.txt to include the new Patient.cpp file in the build.