pub struct ScenarioProfile {
pub id: ScenarioProfileId,
pub scenario_source: ScenarioSource,
pub state: ProfileState,
pub dep_graph: Option<LearnedDepGraph>,
pub exploration: Option<LearnedExploration>,
pub strategy: Option<LearnedStrategy>,
pub bootstrap: Option<BootstrapData>,
pub validation: Option<ValidationResult>,
pub stats: ProfileStats,
pub created_at: u64,
pub updated_at: u64,
}Expand description
永続的に改善されるシナリオの実体
Scenario(静的定義)に対する学習結果を管理する Entity。 各学習コンポーネントは独立して更新可能。
Fields§
§id: ScenarioProfileIdProfile ID
scenario_source: ScenarioSourceシナリオソース参照
state: ProfileStateライフサイクル状態
dep_graph: Option<LearnedDepGraph>学習済み依存グラフ
exploration: Option<LearnedExploration>学習済み探索パラメータ
strategy: Option<LearnedStrategy>学習済み戦略設定
bootstrap: Option<BootstrapData>Bootstrap 完了データ
validation: Option<ValidationResult>検証結果(Validator の出力)
stats: ProfileStats統計情報
created_at: u64作成日時
updated_at: u64更新日時
Implementations§
Source§impl ScenarioProfile
impl ScenarioProfile
Sourcepub fn new(id: impl Into<String>, source: ScenarioSource) -> ScenarioProfile
pub fn new(id: impl Into<String>, source: ScenarioSource) -> ScenarioProfile
新規作成(Draft 状態)
Sourcepub fn from_file(
id: impl Into<String>,
path: impl AsRef<Path>,
) -> ScenarioProfile
pub fn from_file( id: impl Into<String>, path: impl AsRef<Path>, ) -> ScenarioProfile
ファイルパスから作成
Sourcepub fn start_bootstrap(&mut self)
pub fn start_bootstrap(&mut self)
Bootstrap 開始
Sourcepub fn complete_bootstrap(&mut self, data: BootstrapData)
pub fn complete_bootstrap(&mut self, data: BootstrapData)
Bootstrap 完了(→ Validating)
Sourcepub fn apply_validation(&mut self, result: ValidationResult)
pub fn apply_validation(&mut self, result: ValidationResult)
検証結果を適用
Validator の出力を受け取り、状態を遷移させる。
- passed → Active
- failed → Failed
Sourcepub fn skip_validation(&mut self)
pub fn skip_validation(&mut self)
検証をスキップして Active に遷移(Bootstrap のみで使用可能にする場合)
Sourcepub fn start_optimizing(&mut self)
pub fn start_optimizing(&mut self)
Optimizing 開始
Sourcepub fn finish_optimizing(&mut self)
pub fn finish_optimizing(&mut self)
Optimizing 完了
Sourcepub fn update_dep_graph(&mut self, dep_graph: LearnedDepGraph)
pub fn update_dep_graph(&mut self, dep_graph: LearnedDepGraph)
DepGraph を更新
Sourcepub fn update_exploration(&mut self, exploration: LearnedExploration)
pub fn update_exploration(&mut self, exploration: LearnedExploration)
Exploration を更新
Sourcepub fn update_strategy(&mut self, strategy: LearnedStrategy)
pub fn update_strategy(&mut self, strategy: LearnedStrategy)
Strategy を更新
Sourcepub fn record_run(&mut self, success: bool, duration_ms: u64)
pub fn record_run(&mut self, success: bool, duration_ms: u64)
実行結果を記録
Sourcepub fn min_confidence(&self) -> f64
pub fn min_confidence(&self) -> f64
全コンポーネントの最小信頼度
Sourcepub fn avg_confidence(&self) -> f64
pub fn avg_confidence(&self) -> f64
全コンポーネントの平均信頼度
Trait Implementations§
Source§impl Clone for ScenarioProfile
impl Clone for ScenarioProfile
Source§fn clone(&self) -> ScenarioProfile
fn clone(&self) -> ScenarioProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScenarioProfile
impl Debug for ScenarioProfile
Source§impl<'de> Deserialize<'de> for ScenarioProfile
impl<'de> Deserialize<'de> for ScenarioProfile
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScenarioProfile, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScenarioProfile, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ProfileToOfflineModel for ScenarioProfile
impl ProfileToOfflineModel for ScenarioProfile
Source§fn to_offline_model(&self) -> OfflineModel
fn to_offline_model(&self) -> OfflineModel
OfflineModel に変換
Source§impl Serialize for ScenarioProfile
impl Serialize for ScenarioProfile
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ScenarioProfile
impl RefUnwindSafe for ScenarioProfile
impl Send for ScenarioProfile
impl Sync for ScenarioProfile
impl Unpin for ScenarioProfile
impl UnwindSafe for ScenarioProfile
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