Plan Completion Status in Refinery Production Planning

       Production plans define target volumes for feedstock supply, product shipments, and throughput limits in refinery production planning. During refinery simulation, comparing planned and actual values alone does not clearly indicate whether a production plan is incomplete, nearly finished, completed, or overfulfilled. PlanCompletionStatus standardizes plan evaluation by converting completion ratios into clearly defined execution states. The enumeration is used by multiple refinery production planning components, including Source, ShipmentNode, and FlowQuota, to provide consistent plan evaluation across refinery simulation models. This article explains the available completion statuses, the thresholds used by the library, and their practical applications in refinery simulation models.

What Is PlanCompletionStatus?

       PlanCompletionStatus is an enumeration that classifies the execution state of refinery production plans based on the ratio between the actual processed volume and the planned volume. It provides a standardized representation of plan status for refinery simulation models. Instead of working directly with numeric completion percentages, simulation models can use a predefined status that clearly indicates the current level of plan fulfillment. This standardized approach simplifies production planning, improves the readability of refinery simulation results, and provides consistent production plan evaluation across Petroleum Refining Library components.
The status is determined automatically by the static PlanCompletionStatus.from() method, which returns one of five predefined values depending on the completion ratio.

Status Descriptions

PlanCompletionStatus defines five standardized states that describe the execution progress of a refinery production planning. Each status corresponds to a specific completion range and provides a consistent interpretation of plan execution across the library components.

Why Can a Plan Be Overcompleted?

       Exceeding the planned production volume does not necessarily indicate a modeling error. In real refinery operations, production targets may intentionally be exceeded because of equipment limitations, shipment sizes, or operational policies. For example, when ShipmentNode is configured with allowOverPlanning, additional material can continue to be transferred after the planned volume has been reached instead of being blocked. Another common case is LoadingRack. Since trucks and railcars have fixed capacities, the remaining planned volume cannot always be loaded exactly. For example, if 25 t remain but the next truck holds 30 t, the final shipped volume becomes 30 t instead of 25 t. Overcompletion is common in real refinery operations because physical transfer systems often operate with discrete shipment sizes rather than continuously adjustable volumes.
       For these reasons, the library classifies such situations as PLAN_OVERCOMPLETED, indicating that the production target has been exceeded for operational reasons.

Using PlanCompletionStatus in AnyLogic

       During refinery simulation, the completion status can be obtained directly from the completion ratio using the PlanCompletionStatus.from() method. The returned status can be used directly in simulation logic without repeatedly comparing completion percentages.
double completionRatio = actualVolume / plannedVolume;

PlanCompletionStatus status =
        PlanCompletionStatus.from(completionRatio);

The returned status can then be used to simplify simulation logic.

switch (status) {
    case PLAN_NOT_COMPLETED:
        // Continue production
        break;

    case PLAN_COMPLETED:
        // Mark plan as completed
        break;

    case PLAN_OVERCOMPLETED:
        // Handle overplanning
        break;

    default:
        break;
}
The complete implementation is available in the PlanCompletionStatus.java source file.
       Using PlanCompletionStatus eliminates repeated percentage comparisons throughout refinery simulation models and makes production planning logic easier to maintain.

Summary

       Instead of comparing completion percentages throughout refinery simulation models, developers can rely on a single standardized execution state, resulting in simpler code, more consistent reporting, and uniform behavior across Petroleum Refining Library components.

FAQ

1. Why not use only completion percentages?
Raw percentages require repeated threshold checks throughout refinery simulation models. PlanCompletionStatus provides a standardized interpretation that simplifies simulation logic and ensures consistent behavior across components.

2. Why is a plan considered completed at 95% instead of 100%?
The thresholds are predefined design decisions in Petroleum Refining Library and provide a consistent interpretation of plan completion across all components.

3. Is PLAN_OVERCOMPLETED an error?
No. It indicates that the processed volume exceeded the planned target. This can occur intentionally, for example when ShipmentNode allows overplanning or when LoadingRack loads fixed shipment sizes.

4. Which components use PlanCompletionStatus?
The status is used consistently by Source, ShipmentNode, and FlowQuota to evaluate production plan progress across refinery simulation models.

5. Can I change the completion thresholds?
No. The thresholds are fixed within the library to ensure consistent interpretation of production plan execution across all Petroleum Refining Library components.