feat: introduce comprehensive simulation analysis module with detailed performance and material flow tracking.
This commit is contained in:
@@ -203,6 +203,28 @@ function Analyzer() {
|
||||
>
|
||||
>({});
|
||||
|
||||
const resetAllRefs = () => {
|
||||
assetCyclesRef.current = {};
|
||||
assetStateChangesRef.current = {};
|
||||
materialAdditionsRef.current = {};
|
||||
materialRemovalsRef.current = {};
|
||||
materialProcessingTimesRef.current = {};
|
||||
wipSnapshotsRef.current = {};
|
||||
throughputSnapshotsRef.current = {};
|
||||
performanceSnapshotsRef.current = {};
|
||||
bottleneckEventsRef.current = {};
|
||||
previousAssetStatesRef.current = {};
|
||||
materialLifecycleRef.current = {};
|
||||
setAnalysis(null);
|
||||
setAnalyzing(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!isPlaying) {
|
||||
resetAllRefs();
|
||||
}
|
||||
}, [isPlaying]);
|
||||
|
||||
// ============================================================================
|
||||
// ENHANCED UTILITY FUNCTIONS
|
||||
// ============================================================================
|
||||
@@ -2157,6 +2179,14 @@ function Analyzer() {
|
||||
performAnalysisRef.current = performAnalysis;
|
||||
}, [performAnalysis]);
|
||||
|
||||
// Trigger analysis when assets or materials change
|
||||
useEffect(() => {
|
||||
if (!isPlaying) return;
|
||||
|
||||
// Perform analysis when any asset or material state changes
|
||||
performAnalysisRef.current();
|
||||
}, [conveyors, vehicles, armBots, machines, humans, cranes, materials, isPlaying]);
|
||||
|
||||
// Perform initial analysis and set up interval
|
||||
useEffect(() => {
|
||||
if (!isPlaying) return;
|
||||
|
||||
Reference in New Issue
Block a user