'.join(my_order))\nprint('feasible:', ok, '|', reason)\n# Name the discovered constraint + reason-class for Step C:\nmy_constraint = ('finger_left', 'cover') # EDIT to a true edge\nmy_reason_class = 'FASTEN' # ACCESS | FIT | FASTEN","label":"3 — Your order (EDIT)"},{"code":"VALID_CLASS = {'FASTEN','ACCESS'} # the bolted-cover edge is fasten/access, not FIT\nproblems = []\nif not ok:\n problems.append(reason + ' - move it earlier.')\nif set(my_order) != set(PARTS) or len(my_order) != 6:\n problems.append('every one of the 6 parts must appear exactly once.')\nedge_ok = tuple(my_constraint) in PRECEDENCE\nif not edge_ok:\n problems.append('the named constraint is not a true precedence edge.')\nif my_reason_class not in VALID_CLASS:\n problems.append(f'reason-class {my_reason_class} rejected - the cover bolts pass THROUGH the finger tabs (ACCESS/FASTEN).')\n\nif ok and edge_ok and my_reason_class in VALID_CLASS and len(my_order)==6:\n print('PASS - feasible order, all 6 placed, 0 blocked. You named the finger->cover '\n 'fastening constraint with the right reason-class. Sequencing mastered.')\nelse:\n print('FAIL - ' + ' '.join(problems[:2]))","label":"4 — Autograder (seed 4001)"}],"intro":"The precedence feasibility checker from the Bench spec — a part is placeable iff all its precedence-parents are placed. Edit your order and run.","key":"manufacturing/assembly-sequencing","kind":"python","title":"Assembly sequencing"}">
PYTHON · NUMPY · IN-BROWSER
Assembly sequencing
The precedence feasibility checker from the Bench spec — a part is placeable iff all its precedence-parents are placed. Edit your order and run.