Skip to content

Feature Request: Create a Tracker Class for Monitoring Simulation Metrics #40

@csmangum

Description

@csmangum

Feature Request: Create a Tracker Class for Monitoring Simulation Metrics

Description

We need a flexible Tracker class that can be inherited by other classes to track specific aspects of the Krebs Cycle simulation. This will enable better organization of tracking logic and allow for modular tracking of different metrics like energy yield, CO₂ production, NAD+/NADH ratios, and more.

Goals

  • Create a Tracker base class that will serve as a parent for tracking different simulation metrics.
  • Implement child classes that inherit from Tracker to monitor specific metrics, such as:
    • EnergyTracker: Tracks ATP yield, NADH, and FADH₂ contributions to energy production.
    • CO2Tracker: Monitors CO₂ production and ensures it matches expected outputs.
    • RedoxBalanceTracker: Keeps track of NAD+/NADH and FAD/FADH₂ ratios.
    • MetaboliteLevelTracker: Logs and tracks changes in specific metabolites like citrate, α-ketoglutarate, succinate, etc.
    • ProtonGradientTracker: Monitors the formation and utilization of the proton gradient during oxidative phosphorylation.

Proposed Structure

  • Tracker Class:

    • Methods:
      • start_tracking(): Initialize tracking.
      • log_change(metric: str, value: float): Log changes in the specified metric.
      • report(): Generate a summary report of tracked values.
      • reset(): Reset the tracker for a new simulation run.
    • Attributes:
      • tracked_metrics: Dictionary or list to store metric values over time.
      • simulation_step: Tracks the current simulation step to correlate logs with time.
  • Example Inherited Classes:

    • EnergyTracker(Tracker)
      • Tracks energy production, ATP yield, and contributions from NADH and FADH₂.
    • CO2Tracker(Tracker)
      • Logs CO₂ production per cycle and compares it to expected values.
    • RedoxBalanceTracker(Tracker)
      • Monitors the ratio of NAD+/NADH and adjusts the simulation if imbalances are detected.

Acceptance Criteria

  • A Tracker base class is implemented with methods for tracking, logging, and reporting.
  • At least two inherited classes (e.g., EnergyTracker, CO2Tracker) are implemented for tracking specific simulation metrics.
  • Unit tests are included to verify the functionality of each tracker, ensuring accurate logging and reporting of metrics.
  • Documentation is provided for the Tracker class and its child classes, including usage examples and sample outputs.

Benefits

  • Modularizes tracking logic, making it easier to add new tracking features in the future.
  • Improves the readability and maintainability of the simulation code by separating tracking concerns.
  • Enables detailed analysis of specific simulation metrics, aiding in validation and debugging.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions