|
OptiPy
|
Encapsulates the complete output of a flow shop scheduling optimization. More...
#include <FlowShopResult.h>
Public Attributes | |
Solution | |
| std::vector< size_t > | sequence |
| Job execution sequence (job ordering). | |
Timing Metrics | |
| uint64_t | makespan |
| Total completion time (makespan) of the schedule. | |
| std::vector< std::vector< uint64_t > > | completionTimes |
| Completion times matrix: when each job finishes on each machine. | |
Tardiness Metrics | |
| std::vector< uint64_t > | tardiness |
| Per-job tardiness values (lateness from due dates). | |
Optimization Progress | |
| std::vector< double > | fitnesses |
| Convergence history: best fitness per generation. | |
Encapsulates the complete output of a flow shop scheduling optimization.
FlowShopResult contains all relevant data from a flow shop optimization run, including the best job sequence found, timing metrics, and (for metaheuristic optimizations) the convergence history showing how fitness improved over time.
Output from NEH Heuristic:
When calling FlowShop::runNEH(), the result contains:
Output from Differential Evolution:
When calling FlowShop::runDE(), the result contains:
Data Relationships:
The fields are internally consistent and derived from a single optimal job sequence. Specifically:
Usage Example:
Thread Safety:
FlowShopResult is not thread-safe for concurrent modifications. However, once fully constructed by the optimizer, it can be safely read by multiple threads without synchronization.
| std::vector<std::vector<uint64_t> > FlowShopResult::completionTimes |
Completion times matrix: when each job finishes on each machine.
A matrix where completionTimes[i][j] represents the time at which the job at position i in the sequence completes on machine j.
Dimensions: num_jobs rows × num_machines columns
Indexing:
Example: For a 3-job, 2-machine problem:
Flow Shop Properties:
Blocking Constraint: If blocking is enabled, additional constraint:
Tardiness Calculation: tardiness[i] = max(0, completionTimes[i][num_machines-1] - due_date[sequence[i]])
Size: num_jobs × num_machines
| std::vector<double> FlowShopResult::fitnesses |
Convergence history: best fitness per generation.
A vector tracking the best objective value found at each generation during metaheuristic optimization. Enables analysis of optimization progress and assessment of convergence quality.
Semantics:
Content:
Size:
Example: For a DE run with maxGenerations=100:
Analysis Use Cases:
When to Use:
When Empty:
| uint64_t FlowShopResult::makespan |
Total completion time (makespan) of the schedule.
The time at which the final job finishes on the final machine. Represents the total elapsed time from the start of the first job until the completion of the last job.
Definition: makespan = completionTimes[num_jobs - 1][num_machines - 1]
Unit: Time units as specified in the problem data (seconds, minutes, etc.)
Semantics:
Example: If a problem with 3 jobs and 2 machines has:
| std::vector<size_t> FlowShopResult::sequence |
Job execution sequence (job ordering).
A permutation of job indices [0, num_jobs-1] representing the optimal schedule found by the optimizer. The vector has length num_jobs.
Interpretation:
Example: If sequence = [2, 0, 1], the execution order is: job 2, then job 0, then job 1.
Size: num_jobs (the number of jobs in the problem)
Valid Range: Each element is in [0, num_jobs-1], all elements are distinct.
| std::vector<uint64_t> FlowShopResult::tardiness |
Per-job tardiness values (lateness from due dates).
A vector where tardiness[i] represents how late the job at position i is relative to its due date.
Definition: tardiness[i] = max(0, completionTimes[i][num_machines-1] - due_date[sequence[i]])
Semantics:
Unit: Time units (same as completion times)
Example: If due_dates = [20, 30, 25] and jobs finish at [15, 35, 22]:
Size: num_jobs (length matches sequence and completionTimes rows)
When Populated:
Related Objective: