Skip to main content

MutationLogic

Trait MutationLogic 

Source
pub trait MutationLogic<N, E, S, R>: Send + Sync
where N: Debug + Clone, E: Debug + Clone, S: MapState, R: Rules,
{ // Required methods fn interpret( &self, input: &dyn MutationInput, map: &GraphMap<N, E, S>, actions: &ActionsConfig, rules: &R, stats: &SwarmStats, ) -> Vec<MapUpdate<N, E, S>>; fn initialize( &self, root_id: MapNodeId, initial_contexts: &[&str], rules: &R, ) -> Vec<MapUpdate<N, E, S>>; fn create_node_data(&self, input: &dyn MutationInput) -> N; fn create_edge_data(&self, input: &dyn MutationInput) -> E; fn initial_state(&self) -> S; fn name(&self) -> &str; }
Expand description

Map 展開ロジック

入力を MapUpdate に変換する責務のみを持つ。 Selection とは分離されている。

Required Methods§

Source

fn interpret( &self, input: &dyn MutationInput, map: &GraphMap<N, E, S>, actions: &ActionsConfig, rules: &R, stats: &SwarmStats, ) -> Vec<MapUpdate<N, E, S>>

入力を MapUpdate に変換

stats を参照して展開ロジックを調整できる(Optional)。

Source

fn initialize( &self, root_id: MapNodeId, initial_contexts: &[&str], rules: &R, ) -> Vec<MapUpdate<N, E, S>>

初期ノードを展開

Source

fn create_node_data(&self, input: &dyn MutationInput) -> N

ノードデータを生成

Source

fn create_edge_data(&self, input: &dyn MutationInput) -> E

エッジデータを生成

Source

fn initial_state(&self) -> S

初期状態を生成

Source

fn name(&self) -> &str

名前

Implementors§