-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a
debug
feature to both crates to allow access to the internal …
…data without needing to fork everything.
- Loading branch information
Showing
6 changed files
with
157 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Re-export Line so we can use it to provide debug data. | ||
pub use crate::linear_programming::Line; | ||
|
||
/// Internal data that is used to generate the final suggested velocity. | ||
pub enum DebugData { | ||
/// The original problem (where the agent uses its current velocity) was | ||
/// solved. | ||
Satisfied { | ||
/// The constraints that needed to be satisfied. | ||
constraints: Vec<Line>, | ||
}, | ||
/// The original problem (where the agent uses its current velocity) was | ||
/// invalid, so the algorithm fell back to pretending the agent has a | ||
/// zero-velocity, which is trivially satisfiable. | ||
Fallback { | ||
/// The constraints for the original problem. | ||
original_constraints: Vec<Line>, | ||
/// The constraints after falling back (pretending the agent has zero | ||
/// velocity). | ||
fallback_constraints: Vec<Line>, | ||
}, | ||
} |
This file contains 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
This file contains 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
This file contains 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