Commit graph

6 commits

Author SHA1 Message Date
Michael Winter 861d012a95 Refactor: Unify Candidate and PathStep, fix DCA Hamiltonian
- Remove Candidate class, use PathStep for both hypothetical and actual steps
- Simplify Path.step() to accept a PathStep
- Fix DCA Hamiltonian to return visit_count directly instead of normalized score
- Tests pass and DCA properly discriminates
2026-03-16 16:53:22 +01:00
Michael Winter 400f970858 Rename graph.py to pathfinder.py
- Rename graph.py to pathfinder.py for clearer naming
- Update all imports
- Test CLI and tests pass
2026-03-16 16:13:19 +01:00
Michael Winter 1926930c3d Refactor PathStep to represent edges with source/destination and before/after state
- Add callback and interval parameters to find_stochastic_path() for adaptive weights
- Add get_influence() method to compute weighted score contribution per factor
- Rename graph_node/output_chord to source_node/destination_node/source_chord/destination_chord
- Rename voice_stay_count to sustain_count_before/after
- Rename node_visit_counts to last_visited_count_before/after
- Remove redundant internal state from Path - derive from steps
- Each PathStep now fully self-contained with before/after state
2026-03-16 14:00:10 +01:00
Michael Winter c682a1df02 Fix voice stay count to match master behavior
Changed voice stay count calculation in Path.step() to compare
by position (position i with position i) instead of tracking
voice identity. This makes dca_voice_movement factor behave
identically to master.
2026-03-16 02:27:21 +01:00
Michael Winter f2b785c98e Encapsulate voice-leading in Path.step()
- Move transposition, voice mapping into Path.step()
- Add node_visit_counts and voice_stay_count to each PathStep
- Fix voice tracking to use voice identity, not position
- Clean up unused last_graph_nodes code
- Full encapsulation: Path handles all voice-leading state
2026-03-16 01:11:15 +01:00
Michael Winter 66669de00f Add Path and Candidate classes for path state tracking
- Add src/path.py with Path and PathStep classes
- Path stores initial_chord, steps, weights_config
- PathStep stores graph_node, output_chord, transposition, movements, scores, candidates
- Refactor find_stochastic_path to use candidates approach
- Separate _build_candidates (raw scores) from _compute_weights
- Simplify return type to Path only (graph_chords available via property)
- Update io.py to use new Path API
2026-03-16 00:39:32 +01:00