Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions uc-deliveries/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion uc-deliveries/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "solverforge_deliveries"
path = "src/main.rs"

[dependencies]
solverforge = { version = "0.25.0", features = [
solverforge = { version = "0.25.1", features = [
"serde",
"console",
"verbose-logging",
Expand Down
2 changes: 1 addition & 1 deletion uc-deliveries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ make help
- Package: `solverforge-deliveries`; version is declared in `Cargo.toml`
- Release binary: `solverforge_deliveries`
- Rust: `1.95`
- SolverForge runtime: `solverforge` `0.25.0`
- SolverForge runtime: `solverforge` `0.25.1`
- Browser UI assets: `solverforge-ui` `0.9.0`
- Routing engine: `solverforge-maps` `2.1.5`
- Scaffold metadata: `solverforge-cli` `2.2.2` in `solverforge.app.toml`
Expand Down
2 changes: 1 addition & 1 deletion uc-deliveries/WIREFRAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ It shows how to combine:
│ Embedded search policy for construction heuristics and local search.
├── solverforge.app.toml
│ App metadata, demo IDs, model facts/entities, registry dependency sources,
│ and the `solverforge 0.25.0` runtime target.
│ and the `solverforge 0.25.1` runtime target.
├── Makefile
│ Local build, validation, live-road, and Space/Docker commands.
├── Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions uc-deliveries/solverforge.app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ cli_version = "2.2.2"
shell = "web"

[runtime]
target = "solverforge 0.25.0"
runtime_source = "crates.io: solverforge 0.25.0"
target = "solverforge 0.25.1"
runtime_source = "crates.io: solverforge 0.25.1"
ui_source = "crates.io: solverforge-ui 0.9.0"

[demo]
Expand Down
16 changes: 16 additions & 0 deletions uc-deliveries/src/constraints/assemble.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Assembles the constraint set the solver scores every plan against.

use crate::domain::Plan;
use solverforge::prelude::*;

/// Collects the full scoring model used by `Plan`.
pub fn create_constraints() -> impl ConstraintSet<Plan, HardSoftScore> {
// @solverforge:begin constraint-calls
(
super::all_deliveries_assigned::constraint(),
super::vehicle_capacity::constraint(),
super::delivery_time_windows::constraint(),
super::total_travel_time::constraint(),
)
// @solverforge:end constraint-calls
}
24 changes: 3 additions & 21 deletions uc-deliveries/src/constraints/mod.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,15 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Constraint assembly for delivery routing.
//!
//! Each sibling file contributes one named rule. `create_constraints()` lists
//! them in the order we want beginners to see in score analysis output.

use crate::domain::Plan;
use solverforge::prelude::*;

pub use self::assemble::create_constraints;

// @solverforge:begin constraint-modules
mod all_deliveries_assigned;
mod vehicle_capacity;
mod delivery_time_windows;
mod total_travel_time;
mod vehicle_capacity;
// @solverforge:end constraint-modules

mod assemble {
use super::*;
mod assemble;

/// Collects the full scoring model used by `Plan`.
pub fn create_constraints() -> impl ConstraintSet<Plan, HardSoftScore> {
// @solverforge:begin constraint-calls
(
all_deliveries_assigned::constraint(),
vehicle_capacity::constraint(),
delivery_time_windows::constraint(),
total_travel_time::constraint(),
)
// @solverforge:end constraint-calls
}
}
pub use assemble::create_constraints;
32 changes: 16 additions & 16 deletions uc-fleet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions uc-fleet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ name = "solverforge-fleet"
path = "src/main.rs"

[dependencies]
solverforge = { version = "0.25.0", features = ["serde", "console", "verbose-logging"] }
solverforge-core = "0.25.0"
solverforge = { version = "0.25.1", features = ["serde", "console", "verbose-logging"] }
solverforge-core = "0.25.1"
solverforge-ui = "0.9.0"
# Web server
axum = "0.8.9"
Expand Down
2 changes: 1 addition & 1 deletion uc-fleet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ local command surface.

- Package and release binary: `solverforge-fleet` `0.1.0`
- Rust: `1.95`
- SolverForge runtime: `solverforge` and `solverforge-core` `0.25.0`, locked
- SolverForge runtime: `solverforge` and `solverforge-core` `0.25.1`, locked
across the whole `solverforge-*` family
- Browser UI assets: `solverforge-ui` `0.9.0`
- Scaffold metadata: `solverforge-cli` `2.2.2` in `solverforge.app.toml`
Expand Down
4 changes: 2 additions & 2 deletions uc-fleet/solverforge.app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ starter = "neutral-shell"
cli_version = "2.2.2"

[runtime]
target = "solverforge 0.25.0"
runtime_source = "crates.io: solverforge 0.25.0"
target = "solverforge 0.25.1"
runtime_source = "crates.io: solverforge 0.25.1"
ui_source = "crates.io: solverforge-ui 0.9.0"

[demo]
Expand Down
26 changes: 26 additions & 0 deletions uc-fleet/src/constraints/assemble.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//! Assembles the constraint set the solver scores every plan against.

use crate::domain::Plan;
use solverforge::prelude::*;

pub fn create_constraints() -> impl ConstraintSet<Plan, HardSoftScore> {
// @solverforge:begin constraint-calls
(
super::dock_capacity::constraint(),
super::dock_compatibility::constraint(),
super::dock_outage::constraint(),
super::inspection_training_precedence::constraint(),
super::maximize_ready_days::constraint(),
super::minimize_churn::constraint(),
super::minimize_deferral::constraint(),
super::minimize_inspection_lateness::constraint(),
super::minimize_overtime::constraint(),
super::minimize_readiness_shortfall::constraint(),
super::parts_availability::constraint(),
super::required_assignments::constraint(),
super::technician_capacity::constraint(),
super::weekly_readiness_floor::constraint(),
super::work_window::constraint(),
)
// @solverforge:end constraint-calls
}
39 changes: 3 additions & 36 deletions uc-fleet/src/constraints/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/* Constraint definitions.

Add constraint modules with `solverforge generate constraint ...`.
The neutral shell starts with an empty constraint set. */

use crate::domain::Plan;
use solverforge::prelude::*;

pub use self::assemble::create_constraints;

// @solverforge:begin constraint-modules
mod dock_capacity;
mod dock_compatibility;
Expand All @@ -26,30 +16,7 @@ mod weekly_readiness_floor;
mod work_window;
// @solverforge:end constraint-modules

mod assemble {
use super::*;

pub fn create_constraints() -> impl ConstraintSet<Plan, HardSoftScore> {
// @solverforge:begin constraint-calls
(
dock_capacity::constraint(),
dock_compatibility::constraint(),
dock_outage::constraint(),
inspection_training_precedence::constraint(),
maximize_ready_days::constraint(),
minimize_churn::constraint(),
minimize_deferral::constraint(),
minimize_inspection_lateness::constraint(),
minimize_overtime::constraint(),
minimize_readiness_shortfall::constraint(),
parts_availability::constraint(),
required_assignments::constraint(),
technician_capacity::constraint(),
weekly_readiness_floor::constraint(),
work_window::constraint(),
)
// @solverforge:end constraint-calls
}
}

mod assemble;
pub(crate) mod support;

pub use assemble::create_constraints;
2 changes: 1 addition & 1 deletion uc-fleet/tests/project_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn public_dataset_and_daily_readiness_contract_are_explicit() {
let builders = read("src/data/data_seed/builders.rs");
let data_seed = read("src/data/data_seed.rs");
let readiness = read("src/constraints/support/readiness.rs");
let constraints = read("src/constraints/mod.rs");
let constraints = read("src/constraints/assemble.rs");

assert_eq!(catalog.matches("VesselSpec { id:").count(), 24);
assert_eq!(catalog.matches("wp!(").count(), 24);
Expand Down
Loading
Loading