Verify Paths¶
This module validates solver outputs against scene constraints. Use it to check whether a produced path collection is collision-free and consistent.
Typical usage¶
from discopygal.solvers_infra.verify_paths import verify_paths
ok, message = verify_paths(scene, paths)
if not ok:
print("Invalid solution:", message)
See also¶
- discopygal.solvers_infra.verify_paths.verify_paths(scene: Scene, paths: PathCollection)¶
Get a scene and a path, and verify that the given path collection is indeed a valid solution
- Parameters:
scene (
Scene) – scenepaths (:class:~discopygal.solvers_infra.PathCollection`) – paths to verify
- Returns:
True if paths are valid and if invalid, return a reason.
- Return type:
bool,str