-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
category: simRelated to the sim subpackagesRelated to the sim subpackagespackage: patchRelated to the patch implementationRelated to the patch implementationpriority: mediumNon-urgent but important taskNon-urgent but important tasksize: mediumEstimated size of issue or PR is mediumEstimated size of issue or PR is mediumtype: featureImprovement or additions to the code baseImprovement or additions to the code base
Description
Description:
Add logging to track simulation events that are not represented by cell states (e.g. cell binding, lysis, etc).
As an example, here I logged the lysis events for my T cell simulations to differentiate apoptosis due to T cell killing.
Current Implementation:
As a first pass, I added a logger in the PatchModuleCytotoxicity class and rerouted the console output to a logging file:
// instantiating logging object in PatchModuleCytotoxicity constructor
FileHandler fileHandler = new FileHandler("apoptosis_log.txt", true);
fileHandler.setFormatter(new SimpleFormatter());
ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setFormatter(new SimpleFormatter());
logger.addHandler(fileHandler);
logger.addHandler(consoleHandler);
logger.setLevel(Level.INFO);
fileHandler.setLevel(Level.INFO);
consoleHandler.setLevel(Level.INFO);
logger.setUseParentHandlers(false);
/** in the step() function... **/
logger.info(
"T cell "
+ cell.getID()
+ " lysis of tissueCell "
+ tissueCell.getID()
+ " at time "
+ sim.getSchedule().getTime());
The output log file (apoptosis_log.txt) currently looks like this:
Jun 16, 2025 1:03:42 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7941 lysis of tissueCell 2941 at time 2090.0 seed 0
Jun 16, 2025 1:03:42 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7872 lysis of tissueCell 3404 at time 2092.0 seed 0
Jun 16, 2025 1:03:44 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7600 lysis of tissueCell 4852 at time 2099.0 seed 0
Jun 16, 2025 1:03:44 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7834 lysis of tissueCell 4564 at time 2101.0 seed 0
Jun 16, 2025 1:03:44 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7606 lysis of tissueCell 4848 at time 2101.0 seed 0
Jun 16, 2025 1:03:44 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7935 lysis of tissueCell 6309 at time 2105.0 seed 0
Jun 16, 2025 1:03:46 AM arcade.patch.agent.module.PatchModuleCytotoxicity step
INFO: T cell 7720 lysis of tissueCell 5090 at time 2112.0 seed 0
....
Issues:
- This greatly adds to the runtime of the simulation due to the amount of lysis events that occur, and the opening and closing of the output file for each lysis event
- Current output file format is not very easily readable and parsable
- Might be hard to scale for adding other types of event logging
Discussion:
- Is there a way to track events globally (Simulation) instead of on the individual (Module) level?
- How often should we be logging events? (should we log every single event? or sum events at x time interval?)
- Suggestions for output file format?
- Suggestions for ways to log without adding to simulation runtime?
@jessicasyu, @cainja if you have time, any input would be especially helpful.
Metadata
Metadata
Assignees
Labels
category: simRelated to the sim subpackagesRelated to the sim subpackagespackage: patchRelated to the patch implementationRelated to the patch implementationpriority: mediumNon-urgent but important taskNon-urgent but important tasksize: mediumEstimated size of issue or PR is mediumEstimated size of issue or PR is mediumtype: featureImprovement or additions to the code baseImprovement or additions to the code base