The Material Ledger system includes a sophisticated event propagation framework that automatically tracks and allocates various attributes (costs, emissions, quality metrics, etc.) as materials flow through the manufacturing process.
Core Propagation Concepts
Event Propagation is the process of following material flows and ensuring that upstream attributes are correctly allocated to downstream movements. This enables full traceability of not just material movement, but also the costs, environmental impacts, and quality attributes that flow with those materials.
Key Principles:
- Attributes follow materials: As materials move through the process, their associated attributes (costs, emissions, etc.) move with them
- Mass-based allocation: When materials are split, attributes are allocated proportionally based on mass
- No artificial inflation: Attributes cannot be scaled up beyond their original values
- Additive accumulation: When materials are combined, their attributes are summed together
Mass-Weighted Allocation Rules
The propagation system handles material transformations using these fundamental rules:
Multi-Source Allocation
When multiple sources feed into a single destination, attributes are allocated based on mass contribution:
- Example: Tank A (60kg, $600 cost) + Tank B (40kg, $300 cost) → Mixed tank (100kg, $900 total cost)
- Result: Each kg of output material carries $9 in allocated cost
- Formula:
allocation_ratio = min(1.0, current_mass / total_upstream_mass)
Splitting/Cutting Operations
When materials are divided, attributes are allocated proportionally:
- Example: 20m steel roll is cut into 20 pieces of 1m each
- Result: Each piece receives 1/20th (5%) of the upstream attributes
- Formula:
allocation_ratio = min(1.0, current_mass / upstream_mass)
No Artificial Inflation
The system prevents unrealistic attribute scaling:
- Rule: If
current_mass > upstream_mass, allocation ratio is capped at 1.0 - Reason: Attributes cannot be artificially inflated beyond their source values
- Reality Check: Additional attributes must come from new material inputs or processing
Propagation Implementation
Core Propagation Methods
Propagation::add(array $events)
- Simple addition of event objects
- Used for combining attributes from the same material flow
- Sums all numeric properties across events
Propagation::massWeightedAdd(LedgerEntry $currentEntry, array $upstream_entries, Type $event_type)
- Advanced mass-based allocation method for multi-source flows
- Calculates allocation ratios for each upstream movement
- Applies proportional allocation based on material quantities
- Works generically for any event type (costing, emissions, quality, etc.)
- Enforces the "no artificial inflation" rule
Integration with Material Flow
Event propagation occurs automatically during the transaction closure lifecycle:
- Equipment Processing: Current equipment calculates incremental attributes
- Upstream Retrieval: System identifies all upstream movements from multiple sources
- Mass Allocation: Applies mass-weighted allocation rules to upstream attributes
- Combination: Combines incremental and allocated attributes
- Attachment: Attaches final attributes to all entries in the transaction