router: rename `Router` to `Route`

`Router`, soon to be written, will be a wrapper over `Board`.
This commit is contained in:
Mikolaj Wielgus 2024-06-28 01:12:37 +02:00
parent 4fa97509e4
commit 244367c4d7
4 changed files with 8 additions and 8 deletions

View File

@ -51,7 +51,7 @@ use std::sync::{Arc, Mutex};
use std::time::Duration; use std::time::Duration;
use topola::math::Circle; use topola::math::Circle;
use topola::router::Router; use topola::router::Route;
struct SimpleRules { struct SimpleRules {
net_clearances: HashMap<(usize, usize), f64>, net_clearances: HashMap<(usize, usize), f64>,
@ -83,7 +83,7 @@ impl RulesTrait for SimpleRules {
// Clunky enum to work around borrow checker. // Clunky enum to work around borrow checker.
enum RouterOrLayout<'a, R: RulesTrait> { enum RouterOrLayout<'a, R: RulesTrait> {
Router(&'a mut Router<'a, R>), Router(&'a mut Route<'a, R>),
Layout(&'a Layout<R>), Layout(&'a Layout<R>),
} }

View File

@ -15,7 +15,7 @@ use crate::{
Layout, NodeIndex, Layout, NodeIndex,
}, },
math::Circle, math::Circle,
router::{navmesh::Navmesh, Router, RouterError}, router::{navmesh::Navmesh, Route, RouterError},
}; };
#[derive(Debug)] #[derive(Debug)]
@ -129,7 +129,7 @@ impl<M: MesadataTrait> Board<M> {
.unwrap() .unwrap()
.to_string(); .to_string();
let mut router = Router::new_from_navmesh(self.layout_mut(), navmesh, 100.0); let mut router = Route::new_from_navmesh(self.layout_mut(), navmesh, 100.0);
let result = router.route_band(self.layout_mut(), 100.0); let result = router.route_band(self.layout_mut(), 100.0);
if let Ok(band) = result { if let Ok(band) = result {

View File

@ -1,8 +1,8 @@
pub mod astar; pub mod astar;
pub mod draw; pub mod draw;
pub mod navmesh; pub mod navmesh;
mod router; pub mod route;
pub mod trace; pub mod trace;
pub mod tracer; pub mod tracer;
pub use router::*; //pub use router::*;

View File

@ -37,7 +37,7 @@ pub enum RouterError {
Astar(#[from] AstarError), Astar(#[from] AstarError),
} }
pub struct Router { pub struct Route {
astar: Astar<Navmesh, f64>, astar: Astar<Navmesh, f64>,
trace: Trace, trace: Trace,
} }
@ -149,7 +149,7 @@ impl<'a, R: RulesTrait> AstarStrategy<Navmesh, f64, BandFirstSegIndex>
} }
} }
impl Router { impl Route {
pub fn new( pub fn new(
layout: &mut Layout<impl RulesTrait>, layout: &mut Layout<impl RulesTrait>,
from: FixedDotIndex, from: FixedDotIndex,