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

View File

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

View File

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

View File

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