pub struct Greedy { /* private fields */ }Expand description
Greedy 選択(ボーナス最大を優先)
探索を行わず、Provider からのボーナスが最も高いノードを選択する。 学習済みデータを活用する場合に有効。
Implementations§
Source§impl Greedy
impl Greedy
pub fn new() -> Self
Sourcepub fn with_weight(weight: f64) -> Self
pub fn with_weight(weight: f64) -> Self
重みを指定して生成
Sourcepub fn compute_score(
&self,
action: &str,
target: Option<&str>,
provider: &dyn LearnedProvider,
) -> f64
pub fn compute_score( &self, action: &str, target: Option<&str>, provider: &dyn LearnedProvider, ) -> f64
スコアを計算(コンテキストなし、後方互換用)
Trait Implementations§
Source§impl<N, E, S> SelectionLogic<N, E, S> for Greedy
impl<N, E, S> SelectionLogic<N, E, S> for Greedy
Source§fn next(
&self,
map: &GraphMap<N, E, S>,
stats: &SwarmStats,
provider: &dyn LearnedProvider,
) -> Option<MapNodeId>
fn next( &self, map: &GraphMap<N, E, S>, stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> Option<MapNodeId>
次のノードを1つ選択
Source§fn select(
&self,
map: &GraphMap<N, E, S>,
count: usize,
_stats: &SwarmStats,
provider: &dyn LearnedProvider,
) -> Vec<MapNodeId>
fn select( &self, map: &GraphMap<N, E, S>, count: usize, _stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> Vec<MapNodeId>
次のノードを複数選択
Source§fn score(
&self,
action: &str,
target: Option<&str>,
_stats: &SwarmStats,
provider: &dyn LearnedProvider,
) -> f64
fn score( &self, action: &str, target: Option<&str>, _stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> f64
ノードのスコアを計算
Auto Trait Implementations§
impl Freeze for Greedy
impl RefUnwindSafe for Greedy
impl Send for Greedy
impl Sync for Greedy
impl Unpin for Greedy
impl UnwindSafe for Greedy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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