pub struct PenaltyBasedColorAssigner { /* private fields */ }Expand description
ペナルティベースの色割り当て管理
keifuのアルゴリズムを参考に、以下のペナルティを考慮して色を割り当てる:
- 隣接レーンペナルティ: 隣接するレーンと同じ色を避ける
- 履歴ペナルティ: 最近使用した色を避ける
- Fork siblingsペナルティ: 同じ分岐元を持つブランチと同じ色を避ける
Implementations§
Source§impl PenaltyBasedColorAssigner
impl PenaltyBasedColorAssigner
Sourcepub fn main_color(&self) -> usize
pub fn main_color(&self) -> usize
メインブランチ用の色を取得
Sourcepub fn assign_with_context(&mut self, ctx: &ColorContext) -> usize
pub fn assign_with_context(&mut self, ctx: &ColorContext) -> usize
コンテキストを考慮して色を割り当て
Sourcepub fn get_lane_color(&self, lane: usize) -> Option<usize>
pub fn get_lane_color(&self, lane: usize) -> Option<usize>
レーンの色を取得
Sourcepub fn release_lane(&mut self, lane: usize)
pub fn release_lane(&mut self, lane: usize)
レーンを解放
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PenaltyBasedColorAssigner
impl RefUnwindSafe for PenaltyBasedColorAssigner
impl Send for PenaltyBasedColorAssigner
impl Sync for PenaltyBasedColorAssigner
impl Unpin for PenaltyBasedColorAssigner
impl UnwindSafe for PenaltyBasedColorAssigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more