-
-
Notifications
You must be signed in to change notification settings - Fork 1
Vehicle Routing Example: Upgrade to 0.5.1 and fix JS issues #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prathje
wants to merge
136
commits into
SolverForge:main
Choose a base branch
from
prathje:feat/vehicle-routing-js-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…son_to_vehicle_route_plan function - Fix VehicleRoutePlanModel validation error by using FastAPI's automatic request parsing - Add missing json_to_vehicle_route_plan function for test compatibility - Improve demo data endpoints to list available demos and get by name - Simplify API endpoints by removing manual JSON parsing
…efactor to domain model methods - Fixed get_shift_overlapping_duration_in_minutes() to match Java implementation - Added domain model methods to Shift class: has_required_skill(), is_overlapping_with_date(), get_overlapping_duration_in_minutes() - Updated constraints to use domain model methods instead of standalone functions - This enables proper graded penalties for unavailable/undesired/desired dates The refactoring follows OOP principles and matches the pattern used in the Java quickstart implementation.
…anding - Add Dockerfile and README for deployment - Replace Timefold branding with SolverForge assets (logo, CSS, icons) - Bind server to 0.0.0.0 for container networking - Fix duplicate refreshSolvingButtons function and initialization race condition
…ocs/getting-started/employee-scheduling/ See our quickstart guide: https://solverforge.org/docs/getting-started/employee-scheduling/
- Add REST endpoints: GET /schedules, GET /schedules/{id}/status, PUT /schedules/analyze
- Add score_analysis.py with DTOs for constraint analysis
- Fix datetime calculations in constraint penalties for transpilation compatibility
- Disable max_shifts_per_employee by default (optional extension)
- Improve test structure with explicit imports and documentation
- Enhance DELETE endpoint to return final schedule
…ge branding Add Docker support, score analysis API with constraint breakdown, visit assignment recommendation endpoints, and Haversine-based distance calculation. Update UI with loading spinner, recommended fit functionality, and SolverForge branding. Add comprehensive tests for constraints, demo data, and haversine calculations.
…tors - Add missing API fields for timeline rendering (startServiceTime, startDateTime, endDateTime) to fix empty/misaligned timelines - Enable "By vehicle" and "By visit" timeline tabs - Show vehicle names (Alpha, Bravo) instead of IDs across all tabs - Add stop number badges (1, 2, 3...) on service segments - Add on-time/late status indicators: - Green checkmark for on-time vehicles/visits - Red warning triangle for late visits - Blue clock icon for early arrivals (waiting) - Add icons for travel, wait, and return-to-depot segments - Add tests for timeline field serialization
… default) - Add commented-out max_route_duration constraint following employee-scheduling pattern - Constraint limits vehicle routes to 8 hours total duration - Penalizes by excess minutes when exceeded - Update test_feasible to skip (yellow) instead of fail if solver doesn't find feasible solution
- Remove distanceMode API parameter (was defaulting to Haversine anyway) - Remove init/clear/is_initialized matrix functions from domain.py - Remove use_precomputed_matrix parameter from generate_demo_data() - Remove TestPrecomputedMatrix test class - Simplify Location.driving_time_to() to always use Haversine The pre-computed matrix feature was never exposed in the UI and defaulted to disabled, making it dead code.
Stock portfolio optimization using boolean selection model: - Select target number of stocks (default 20) with equal weights - 4 constraints: target count (hard), sector limit (hard), unselected penalty (soft), maximize return (soft) - Parameterized constraints via PortfolioConfig problem fact - Dynamic solver termination time (10-300 seconds) Frontend features: - Advanced settings panel with presets (conservative/balanced/aggressive/quick) - Configurable target stocks, max sector %, solver time via sliders - 8 KPI metrics: selected count, expected return, sector count, diversification, max sector exposure, volatility, Sharpe proxy, HHI - Chart.js visualizations for sector allocation and returns Backend: - SolverConfigModel with Pydantic validation - Per-job solver managers for concurrent requests - Business metrics computed on plan (HHI, diversification score, etc.) - Full type annotations (mypy clean) Tests: 113 tests covering constraints, config, metrics, REST API
…saging - Fix TypeError in comparison.py: use selection=SELECTED/NOT_SELECTED instead of selected=True/False to match domain model - Update docstrings to accurately describe when constraint solving excels - Remove false claims about solver "beating" greedy for this simple problem - Use LARGE dataset for more meaningful comparison
Add optional "Real Roads" mode that uses OpenStreetMap road network data via OSMnx for accurate driving times and route geometries, with haversine as the fast default fallback. Key changes: - Add routing.py with DistanceMatrix class and OSMnx integration - Add real street address data for Philadelphia, Hartford, and Florence - Add UI toggle for "Real Roads" mode with SSE progress streaming - Add route geometry rendering on the map using polyline encoding - Add comprehensive unit tests for the routing module The distance matrix is computed during solve startup and cached for the duration of solving. Route geometries are streamed via SSE and displayed as actual road paths instead of straight lines when Real Roads is enabled.
VM placement optimization using constraint solver to assign VMs to servers while respecting capacity limits and affinity/anti-affinity rules. Key features: - PlanningVariable pattern: VM.server is the planning variable - Hard constraints: CPU, memory, storage capacity; anti-affinity groups - Soft constraints: affinity groups, server consolidation, load balancing - Bootstrap UI with rack visualization showing server blades - Real-time utilization bars and VM chip animations during solving - SMALL (20 VMs) and LARGE (94 VMs) demo datasets
- Add configurable infrastructure sliders (racks, servers/rack, VMs, solver time) - Add /demo-data/generate endpoint for custom data generation - Fix server detail modal to show fresh utilization data - Update domain model: VM.server is planning variable, Server is problem fact - Update constraint weights for proper VM placement priority - Add solving pulse animation to summary cards
Create FUNDING.yml
Remove unused code that was kept around but never actually used: - Remove SolverConfig struct (completely unused - solve() API loads from solver.toml) - Remove SolverStatus::as_str() method (unused - serde handles serialization) - Remove non-functional stop signal infrastructure (oneshot channel) - The stop signal was dead code because solve() is synchronous/blocking - try_recv() happened AFTER solving completed, never during - Remove unused imports (Duration, Instant, oneshot) - Simplify solve_blocking() to remove complexity that provided no value The stop_solving() method now only marks status as stopped since the underlying solve() API doesn't support cancellation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SolverStatus implements Copy, so cloning is unnecessary. Replace .clone() with direct copy for status field access. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove dead code from domain.rs that was never actually used: - Remove with_skill() builder (only with_skills() is used) - Remove with_unavailable_date() builder (dates set directly in demo_data) - Remove with_undesired_date() builder (dates set directly in demo_data) - Remove with_desired_date() builder (dates set directly in demo_data) - Remove duration_hours() helper (never called) - Remove get_employee() helper (never called) - Remove employee_count() helper (never called) Only with_skills() builder is retained as it's actively used in demo_data.rs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…e output - Switch from RwLock to Mutex for zero-erasure - Use solve_with_events to emit solver events to console - Add test for empty schedule score handling
Replace manual SolverService wiring with SolutionManager singleton: - Use solver_manager() static accessor - Use solve_and_listen for async solving - Use terminate_early and mark_finished for stopping - Use analyze for constraint analysis via Analyzable trait
Wire vehicle routing to use the fluent SolutionManager API with solve_and_listen pattern matching employee-scheduling quickstart.
- Delete src/console.rs (390 lines of duplicate library functionality) - Remove pub mod console from lib.rs - Remove owo-colors, num-format, tracing, tracing-subscriber deps from Cargo.toml - Simplify main.rs to minimal form without colorized output Library handles tracing internally - no manual subscriber setup needed.
Update test_empty_schedule_has_score to properly use the channel-based solve() method which requires terminate flag and sender arguments.
…ging - Bump version to 0.5.0 - Add verbose-logging feature to solverforge dependency - Track solver status (SOLVING/NOT_SOLVING) in SolveJob - Expose solver_status in ScheduleDto API response - Update status to NOT_SOLVING when channel closes - Add Dockerfile and README for deployment
- Add missing quickstarts to overview table: Hello World, Portfolio Optimization, VM Placement - Reorganize table to show Rust and Python (Legacy) columns - Add detailed sections for all 8 quickstarts - Update solverforge dependency to version 0.5.0 - Add server startup message showing URL and port
…g quickstarts - meeting-scheduling: fix test_feasible.py to use /demo-data/SMALL endpoint instead of /demo-data - The /demo-data endpoint returns a list of dataset names, not actual data - Fixed test_feasible, test_analyze, and test_analyze_constraint_scores - order-picking: update test_constraints.py to use minimize_total_distance - Removed imports for minimize_distance_from_previous_step and minimize_distance_from_last_step_to_origin - These were refactored into minimize_total_distance which aggregates at trolley level - Updated test to verify total round-trip distance (to step + back to origin)
- Add Helm chart for Kubernetes deployment - Chart.yaml with version 0.5.0 - values.yaml with sensible defaults (2Gi limit, 256Mi request) - Deployment, Service, Ingress templates - Health probes using /demo-data endpoint - Update CI/CD pipeline - Add test-rust job with cargo test and build - Add employee-scheduling to build-and-push matrix - Split tests into test-rust and test-python jobs - Add rust/employee-scheduling to trigger paths
meeting-scheduling: - Update create_required_attendance and create_preferred_attendance helpers to return tuples containing both the typed attendance object and a generic Attendance object - room_stability constraint tests now use the Attendance objects (second tuple element) - Other constraint tests use the typed attendance objects (first tuple element) - This allows room_stability constraint to work with the generic Attendance class while other constraints work with typed RequiredAttendance/PreferredAttendance order-picking: - Update minimize_total_distance test to expect correct penalty - Shadow variable distance_from_previous is not triggered in constraint verification tests - Test now correctly expects only the return distance (3m) instead of round-trip (6m)
Add release/** to the CI trigger branches so that tests run on release branches in addition to main and dev branches.
When solving a schedule with 0 entities, the solver may optimize by closing the channel without sending any solutions. Update the test to handle this case gracefully instead of panicking with 'should receive solution'.
- Use Alpine Linux instead of Debian for smaller image size - Build as standalone using published solverforge crate from crates.io - Remove dependency on local solverforge-rs workspace - Build with musl target for static linking - Build context is now just rust/employee-scheduling/ (works with CI)
a0ce88d to
248da5c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello there!
I was just playing around with SolverForge and wanted to check out the vehicle routing example.
I stumbled upon a few small JS issues that I could fix.
Feel free to incorporate them if you want.
Cheers!
Patrick