Bobojy00/moonbit_factory_graph/src/analysis does not have a README file

    BottleneckAnalysisReport

    pub(all) struct BottleneckAnalysisReport {
    takt_time_target_sec : Double
    primary_bottleneck_node_id : String
    primary_bottleneck_cycle_time : Double
    secondary_bottlenecks : Array[String]
    conveyor_bandwidth_bottlenecks : Array[String]
    max_theoretical_hourly_output : Double
    line_balance_efficiency_percent : Double
    } derive(Eq,
    Debug
    )

    EdgeUtilizationSnapshot

    pub(all) struct EdgeUtilizationSnapshot {
    edge_id : String
    source_id : String
    target_id : String
    bandwidth_units_per_hour : Double
    is_active : Bool
    utilization_percent : Double
    is_congested : Bool
    } derive(Eq,
    Debug
    )

    Material edge utilization at a requested production demand.

    MaterialCapacityReport

    pub(all) struct MaterialCapacityReport {
    demand_per_hour : Double
    constrained_capacity_per_hour : Double
    output_capacity_per_hour : Double
    capacity_margin_percent : Double
    edge_utilization : Array[EdgeUtilizationSnapshot]
    overloaded_edge_ids : Array[String]
    constrained_node_ids : Array[String]
    } derive(Eq,
    Debug
    )

    Capacity report for material edges and production assets.

    OperationalReadinessReport

    pub(all) struct OperationalReadinessReport {
    readiness_level : ReadinessLevel
    ready_for_deployment : Bool
    readiness_score : Double
    total_validation_issue_count : Int
    critical_issue_count : Int
    error_issue_count : Int
    warning_issue_count : Int
    orphan_node_ids : Array[String]
    inactive_node_ids : Array[String]
    inactive_edge_ids : Array[String]
    unpowered_asset_ids : Array[String]
    disconnected_controller_ids : Array[String]
    congested_edge_ids : Array[String]
    active_node_ratio_percent : Double
    active_edge_ratio_percent : Double
    mean_asset_availability_percent : Double
    active_flow_layer_count : Int
    capacity_margin_percent : Double
    recommendations : Array[String]
    } derive(Eq,
    Debug
    )

    OutagePortfolioReport

    pub(all) struct OutagePortfolioReport {
    valid_scenario_count : Int
    invalid_node_ids : Array[String]
    scenarios : Array[OutageScenarioScore]
    worst_case_node_id : String
    max_capacity_loss_percent : Double
    average_capacity_loss_percent : Double
    } derive(Eq,
    Debug
    )

    Aggregate result for a batch of outage candidates.

    OutageScenarioScore

    pub(all) struct OutageScenarioScore {
    failed_node_id : String
    affected_asset_count : Int
    affected_workstations_count : Int
    capacity_loss_percent : Double
    estimated_hourly_loss_cny : Double
    resilience_score : Double
    risk_band : String
    } derive(Eq,
    Debug
    )

    One deduplicated outage candidate and its modeled operational impact.

    OutageSimulationResult

    pub(all) struct OutageSimulationResult {
    failed_node_id : String
    power_blackout_nodes : Array[String]
    plc_timeout_nodes : Array[String]
    safety_tripped_nodes : Array[String]
    starved_workstations : Array[String]
    blocked_workstations : Array[String]
    all_impacted_nodes : Array[String]
    production_capacity_loss_percent : Double
    estimated_hourly_loss_cny : Double
    affected_workstations_count : Int
    } derive(Eq,
    Debug
    )

    PlantHealthKPIs

    pub(all) struct PlantHealthKPIs {
    total_asset_count : Int
    active_asset_count : Int
    operational_availability_percent : Double
    total_power_demand_kw : Double
    target_takt_time_sec : Double
    max_output_per_hour : Double
    plant_health_score : Double
    } derive(Eq,
    Debug
    )

    ReadinessLevel

    pub(all) enum ReadinessLevel {
    Ready
    Conditional
    Blocked
    } derive(Compare, Eq,
    Debug
    )

    ReadinessLevel::to_string

    fn ReadinessLevel::to_string(self : ReadinessLevel) -> String

    RedundancyReport

    pub(all) struct RedundancyReport {
    overall_resilience_index : Double
    fully_redundant_routes_count : Int
    single_point_vulnerable_stations : Array[String]
    bypass_path_available : Bool
    resilience_grade : String
    } derive(Eq,
    Debug
    )

    SafetyAuditReport

    pub(all) struct SafetyAuditReport {
    total_safety_zones : Int
    unprotected_machines : Array[String]
    sil_compliant : Bool
    estop_coverage_percent : Double
    audit_status : String
    } derive(Eq,
    Debug
    )

    analyze_material_capacity

    fn analyze_material_capacity(graph :
    FactoryGraph
    , demand_per_hour? : Double) -> MaterialCapacityReport

    Analyze material-flow congestion and the limiting production capacity.

    If demand_per_hour is omitted, the target takt time in the graph configuration is converted to units per hour. Zero or negative edge bandwidth is treated as unavailable capacity instead of producing an infinite utilization value.

    analyze_production_bottlenecks

    audit_operational_readiness

    fn audit_operational_readiness(graph :
    FactoryGraph
    , demand_per_hour? : Double) -> OperationalReadinessReport

    Audit whether a plant graph is complete enough for operational deployment.

    The report combines structural validation, node/edge operating status, flow-layer completeness, material capacity, and asset availability. It is intentionally deterministic so it can be used in release gates and in offline engineering review tools.

    audit_plant_safety_systems

    evaluate_line_redundancy

    fn evaluate_line_redundancy(graph :
    FactoryGraph
    , source_id : String, target_id : String) -> RedundancyReport

    evaluate_outage_portfolio

    fn evaluate_outage_portfolio(graph :
    FactoryGraph
    , candidate_node_ids : Array[String], hourly_downtime_cost? : Double) -> OutagePortfolioReport

    Evaluate unique outage candidates while retaining unknown IDs for input QA.

    Scenarios are evaluated in first-seen order. Duplicate IDs are ignored so a caller can safely concatenate candidate lists from several asset teams.

    simulate_device_outage

    fn simulate_device_outage(graph :
    FactoryGraph
    , failed_node_id : String, hourly_downtime_cost? : Double) -> OutageSimulationResult