Machine Center Overload
The production schedule was drawn as if every machine center had infinitely many machines: operations were planned wherever they fit, and nobody checked whether two of them claim the same machine at the same time. Before the plan is committed, the planner needs two answers per machine center: how many identical machines the center really needs so nothing queues, and exactly which pairs of operations are fighting over one.
Requirements
The starter contains two tables — keep their fields and keys exactly as shipped; the grading tests seed them and read them back:
"Planned Operation" — the schedule your code analyzes:
"Entry No."—Integer, the primary key; an arbitrary insertion number that carries no meaning"Machine Center No."—Code[20], the machine center the operation is planned on"Operation No."—Code[20], identifies the operation"Starting DateTime"—DateTime, when the operation begins"Ending DateTime"—DateTime, when the operation ends
"Operation Conflict" — the result buffer for conflicting pairs:
"First Operation No."—Code[20]"Second Operation No."—Code[20]- primary key: both fields
Create a codeunit named "Machine Load Planner" with two public procedures:
procedure RequiredMachines(var PlannedOperation: Record "Planned Operation"; MachineCenterNo: Code[20]): Integer
procedure FindConflicts(var PlannedOperation: Record "Planned Operation"; MachineCenterNo: Code[20]; var OperationConflict: Record "Operation Conflict")Solve it with Pro
You’re reading the opening of the statement. Pro unlocks the whole problem:
- The full statement
- Starter code in the browser editor
- 15 grading tests, run on Business Central 28.5
- 3 hints
- The reference solution
Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.
Already on Pro? Sign in