Add runnable example programs and update README example instructions#50
Conversation
Generate model-owned source functions on planning solutions instead of public suffix extension traits. Move source metadata through __internal and add the hidden UnassignedEntity hook that powers fluent .unassigned(). Migrate tests, README, wireframes, and root examples to ConstraintFactory::for_each(Plan::field()). Replace the temporary minimal solver with root scalar, list, mixed, and nqueens SolverManager examples.
d88b219 to
d0232ce
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0232ce124
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for node in solution.nodes { | ||
| let color = node | ||
| .color_idx | ||
| .and_then(|idx| solution.colors.get(idx)) |
There was a problem hiding this comment.
Iterate nodes by reference before accessing colors
In the Completed branch, for node in solution.nodes moves the nodes field out of solution, and the loop body then reads solution.colors, which uses a partially moved struct and triggers a borrow checker error (E0382). This prevents the new scalar-graph-coloring example from compiling/building (including via the updated make examples target). Iterate with for node in &solution.nodes (or destructure fields first) so solution.colors remains accessible.
Useful? React with 👍 / 👎.
Motivation
cargo runcommands for each example variant.Description
crates/solverforge/examples/:scalar_graph_coloring.rs,list_tsp.rs,mixed_job_shop.rs, andnqueens.rs, each implementing a small, documented demo problem.README.mdexamples section to referencecrates/solverforge/examples/, added brief example type bullets (Scalar/List/Mixed) and replaced the singlecargo run -p nqueensline with explicitcargo run -p solverforge --example ...invocations for each new example.Testing
cargo build --examples, which completed successfully.cargo test, and all automated tests passed.Codex Task