Files
medicallib/include/MedicalLib/Intestines.h
T
google-labs-jules[bot] 7459435e25 feat: Add detailed simulation to remaining simple organs
This commit applies a detailed physiological model to all remaining simple organ classes, bringing them to a level of complexity consistent with the Heart, Lungs, and Brain.

Updates include:
- Esophagus: Simulates peristalsis and bolus movement.
- Stomach: Implements a gastric state machine for digestion.
- Intestines: Adds segments (duodenum, jejunum, etc.) and simulates absorption.
- Pancreas: Differentiates endocrine and exocrine functions.
- Gallbladder: Simulates storing, concentrating, and releasing bile.
- Kidneys: Models nephrons, GFR, and electrolyte balance.
- Bladder: Implements a micturition cycle with pressure dynamics.
- Spleen: Models red and white pulp for blood filtering and immunity.
2025-08-20 07:11:44 +00:00

62 lines
1.5 KiB
C++

#pragma once
#include "Organ.h"
#include <string>
#include <vector>
/**
* @brief Represents a segment of the intestines.
*/
struct IntestinalSegment {
std::string name;
double length_m;
double motility; // Rate of chyme movement
double nutrientAbsorptionRate;
double waterAbsorptionRate;
};
/**
* @brief Represents the Intestines (Small and Large) with a more detailed model.
*/
class MEDICAL_LIB_API Intestines : public Organ {
public:
/**
* @brief Constructor for the Intestines class.
* @param id The ID of the organ.
*/
Intestines(int id);
/**
* @brief Updates the intestines' state over a time interval.
* @param deltaTime_s The time elapsed in seconds.
*/
void update(double deltaTime_s) override;
/**
* @brief Gets a string summary of the intestines' state.
* @return A string containing the intestines' state.
*/
std::string getSummary() const override;
/**
* @brief Adds chyme from the stomach to the duodenum.
* @param volume_mL The volume of chyme.
*/
void receiveChyme(double volume_mL);
// --- Getters for Intestinal State ---
/** @brief Gets the total volume of chyme currently in the intestines. */
double getTotalChymeVolume() const;
private:
// --- Anatomical Components ---
IntestinalSegment duodenum;
IntestinalSegment jejunum;
IntestinalSegment ileum;
IntestinalSegment colon;
// --- Simulation State ---
double chymeVolume_mL; // Total volume in the whole system for now
};