feat: Add comprehensive simulation analyzer component with detailed tracking, configuration, and performance metrics.
This commit is contained in:
@@ -183,43 +183,12 @@ function Analyzer() {
|
||||
const stateTransitionsRef = useRef<Record<string, any[]>>({});
|
||||
|
||||
// Material flow tracking - tracks materials added/removed per asset
|
||||
const materialAdditionsRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
materialId: string;
|
||||
materialType: string;
|
||||
timestamp: number;
|
||||
fromAsset?: string;
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const materialAdditionsRef = useRef<Record<string, { materialId: string; materialType: string; timestamp: number; fromAsset?: string }[]>>({});
|
||||
|
||||
const materialRemovalsRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
materialId: string;
|
||||
materialType: string;
|
||||
timestamp: number;
|
||||
toAsset?: string;
|
||||
processingTime?: number;
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const materialRemovalsRef = useRef<Record<string, { materialId: string; materialType: string; timestamp: number; toAsset?: string; processingTime?: number }[]>>({});
|
||||
|
||||
// Asset state change tracking with detailed timestamps
|
||||
const assetStateChangesRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
fromState: string;
|
||||
toState: string;
|
||||
timestamp: number;
|
||||
duration?: number;
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const assetStateChangesRef = useRef<Record<string, { fromState: string; toState: string; timestamp: number; duration?: number }[]>>({});
|
||||
|
||||
// Cycle tracking for each asset
|
||||
const assetCyclesRef = useRef<
|
||||
@@ -237,45 +206,13 @@ function Analyzer() {
|
||||
>({});
|
||||
|
||||
// Action completion times for performance analysis
|
||||
const actionCompletionTimesRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
actionId: string;
|
||||
actionType: string;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
duration: number;
|
||||
success: boolean;
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const actionCompletionTimesRef = useRef<Record<string, { actionId: string; actionType: string; startTime: number; endTime: number; duration: number; success: boolean }[]>>({});
|
||||
|
||||
// Material processing times per asset
|
||||
const materialProcessingTimesRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
materialId: string;
|
||||
entryTime: number;
|
||||
exitTime?: number;
|
||||
processingDuration?: number;
|
||||
waitTime?: number;
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const materialProcessingTimesRef = useRef<Record<string, { materialId: string; entryTime: number; exitTime?: number; processingDuration?: number; waitTime?: number }[]>>({});
|
||||
|
||||
// WIP (Work In Progress) tracking per asset over time
|
||||
const wipSnapshotsRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
timestamp: number;
|
||||
wipCount: number;
|
||||
materialIds: string[];
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const wipSnapshotsRef = useRef<Record<string, { timestamp: number; wipCount: number; materialIds: string[] }[]>>({});
|
||||
|
||||
// Throughput snapshots for trend analysis
|
||||
const throughputSnapshotsRef = useRef<
|
||||
@@ -291,44 +228,13 @@ function Analyzer() {
|
||||
>({});
|
||||
|
||||
// Asset performance snapshots
|
||||
const performanceSnapshotsRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
timestamp: number;
|
||||
utilization: number;
|
||||
efficiency: number;
|
||||
quality: number;
|
||||
oee: number;
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const performanceSnapshotsRef = useRef<Record<string, { timestamp: number; utilization: number; efficiency: number; quality: number; oee: number }[]>>({});
|
||||
|
||||
// Bottleneck detection tracking
|
||||
const bottleneckEventsRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
timestamp: number;
|
||||
queueLength: number;
|
||||
utilizationRate: number;
|
||||
waitingMaterials: string[];
|
||||
}[]
|
||||
>
|
||||
>({});
|
||||
const bottleneckEventsRef = useRef<Record<string, { timestamp: number; queueLength: number; utilizationRate: number; waitingMaterials: string[] }[]>>({});
|
||||
|
||||
// Previous state tracking for delta calculations
|
||||
const previousAssetStatesRef = useRef<
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
state: string;
|
||||
isActive: boolean;
|
||||
materialCount: number;
|
||||
timestamp: number;
|
||||
}
|
||||
>
|
||||
>({});
|
||||
const previousAssetStatesRef = useRef<Record<string, { state: string; isActive: boolean; materialCount: number; timestamp: number }>>({});
|
||||
|
||||
// Track previous actions for ArmBots to detect cycle completion
|
||||
const previousArmBotActionsRef = useRef<Record<string, string | undefined>>({});
|
||||
@@ -356,12 +262,7 @@ function Analyzer() {
|
||||
materialId: string;
|
||||
createdAt: number;
|
||||
completedAt?: number;
|
||||
path: {
|
||||
assetId: string;
|
||||
assetType: string;
|
||||
entryTime: number;
|
||||
exitTime?: number;
|
||||
}[];
|
||||
path: { assetId: string; assetType: string; entryTime: number; exitTime?: number }[];
|
||||
totalProcessingTime?: number;
|
||||
totalWaitTime?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user