Skip to content

Energy Flux Tracking & Information Theory Foundation#132

Merged
M1thieu merged 2 commits intoerematorg:mainfrom
M1thieu:main
Jul 8, 2025
Merged

Energy Flux Tracking & Information Theory Foundation#132
M1thieu merged 2 commits intoerematorg:mainfrom
M1thieu:main

Conversation

@M1thieu
Copy link
Collaborator

@M1thieu M1thieu commented Jul 8, 2025

Objective

Implementation

Energy Flux Tracking:

  • Extended EnergyTransaction with transfer_rate and duration fields
  • Added flux analytics to EnergyAccountingLedger for flow pattern analysis
  • Added create_flux_transaction() method for sustained energy transfers

Information Theory:

  • Shannon entropy with conditional and joint calculations
  • KL divergence, Jensen-Shannon divergence for distribution comparison
  • Mutual information with bias correction for emergent behavior analysis

Code Quality:

  • Consolidated duplicate EnergyType definitions
  • Renamed create_standing_wavecreate_standing_wave_parameters for accuracy
  • Removed unused spacetime crate (delegated to Bevy)

Testing

  • All crates compile without breaking changes
  • Energy flux integrates seamlessly with existing conservation system
  • Information theory handles edge cases properly

Visual Changes

// Track energy flows over time
let flux = energy_system.create_flux_transaction(50.0, 10.0, source, target, time);
let avg_rate = ledger.average_transfer_rate(60.0);

// Measure system complexity
let entropy = Shannon::entropy(&behavior_data);
let mutual_info = MutualInfo::discrete(&states_a, &states_b);

Technical Notes

Compatibility: Fully backward compatible

Future Ready: Foundation prepared for physics engine integration

Limitations: Flux assumes linear transfer rates, information theory needs adequate sample sizes

M1thieu added 2 commits June 23, 2025 00:50
Spacetime will be mostly covered by Bevy actually, as I did plan to make my own Engine it's now unnecessary,
Also begin of Information Theory Crate:
- Shannon entropy: conditional H(X|Y), joint H(X,Y), probability-based entropy
- Distribution comparison: KL divergence, Jensen-Shannon, cross-entropy
- Enhanced mutual information with Miller-Madow bias correction
Enhanced the energy conservation system with comprehensive flux tracking capabilities:

- Add transfer_rate and duration fields to EnergyTransaction
- Add flux analytics methods to EnergyAccountingLedger
- Add create_flux_transaction method to EnergySystem trait
- Fix EnergyType duplication between lib.rs and conservation.rs
- Rename create_standing_wave to create_standing_wave_parameters

 Enables tracking of sustained energy flows vs instantaneous transfers for ecosystem dynamics.

Side note for myself, no update for more than 2 weeks as I've been working on PBMPM and yet failed again & again LP physics will have to wait a little more, I'm so sorry to slow down the project ): I think I need help
@M1thieu M1thieu added enhancement New feature or request energy information labels Jul 8, 2025
@M1thieu M1thieu merged commit e62170d into erematorg:main Jul 8, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant