Skip to main content

SelectionLogic

Trait SelectionLogic 

Source
pub trait SelectionLogic<N, E, S>: Send + Sync
where N: Debug + Clone, E: Debug + Clone, S: MapState,
{ // Required methods fn next( &self, map: &GraphMap<N, E, S>, stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> Option<MapNodeId>; fn select( &self, map: &GraphMap<N, E, S>, count: usize, stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> Vec<MapNodeId>; fn score( &self, action: &str, target: Option<&str>, stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> f64; fn name(&self) -> &str; }
Expand description

ノード選択ロジック

次に探索するノードを選択する責務を持つ。 SwarmStats を参照してスコアベースの選択が可能。

§実装者向け

  • next(): 1ノード選択(デフォルト実装あり)
  • select(): 複数ノード選択(必須)
  • score(): スコア計算(デバッグ/可視化用)
  • name(): アルゴリズム名

Required Methods§

Source

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>

次のノードを複数選択

Source

fn score( &self, action: &str, target: Option<&str>, stats: &SwarmStats, provider: &dyn LearnedProvider, ) -> f64

ノードのスコアを計算

Source

fn name(&self) -> &str

名前

Implementors§

Source§

impl<N, E, S> SelectionLogic<N, E, S> for AnySelection
where N: Debug + Clone + ActionExtractor, E: Debug + Clone, S: MapState,

Source§

impl<N, E, S> SelectionLogic<N, E, S> for Fifo
where N: Debug + Clone + ActionExtractor, E: Debug + Clone, S: MapState,

Source§

impl<N, E, S> SelectionLogic<N, E, S> for Greedy
where N: Debug + Clone + ActionExtractor, E: Debug + Clone, S: MapState,

Source§

impl<N, E, S> SelectionLogic<N, E, S> for Thompson
where N: Debug + Clone + ActionExtractor, E: Debug + Clone, S: MapState,

Source§

impl<N, E, S> SelectionLogic<N, E, S> for Ucb1
where N: Debug + Clone + ActionExtractor, E: Debug + Clone, S: MapState,