pub struct Session { /* private fields */ }Expand description
serve の 1 つの場: 読み込んだ系・変更の記録・元に戻す段・走っている最適化などの進み具合と、要求で与えたパスの扱い。
系を変える要求は場ごとに 1 つずつ順に、読むだけの要求(Access::Read)は並行に処理する。
最適化などの長い要求(Access::Long)は始めたときの系で回し、その間も他の要求を止めない。TCP・パイプの serve は 1 つの場を全部の接続で共有し、GUI は global の場を、
試験は場を別々に作って使う
Implementations§
Source§impl Session
impl Session
Sourcepub fn optimize_progress(&self) -> Option<Vec<f64>>
pub fn optimize_progress(&self) -> Option<Vec<f64>>
走っている最適化の、反復ごとの評価関数の値(走っていなければ None)。同じプロセスから呼ぶ(GUI の進み具合)
Sourcepub fn optimize_cancel(&self)
pub fn optimize_cancel(&self)
走っている最適化を止める(次の反復の終わりで止まり、そこまでの結果を返す)。同じプロセスから呼ぶ
Source§impl Session
impl Session
Sourcepub fn tolerance_progress(&self) -> Option<(usize, usize)>
pub fn tolerance_progress(&self) -> Option<(usize, usize)>
走っている公差のモンテカルロの (終えた評価, 評価の数)(感度の 2 × 公差の数 + 試行の数。走っていなければ None)
Sourcepub fn tolerance_cancel(&self)
pub fn tolerance_cancel(&self)
走っている公差のモンテカルロを止める(走っている試行は終わらせ、そこまでの結果を返す)。同じプロセスから呼ぶ
Source§impl Session
impl Session
Sourcepub fn swap_progress(&self) -> Option<(usize, usize)>
pub fn swap_progress(&self) -> Option<(usize, usize)>
走っている差し替え探索の (終えた組, 組の数)(走っていなければ None)。同じプロセスから呼ぶ
Sourcepub fn swap_cancel(&self)
pub fn swap_cancel(&self)
走っている差し替え探索を止める(走っている組は終わらせ、そこまでの結果を返す)。同じプロセスから呼ぶ
Source§impl Session
impl Session
Source§impl Session
impl Session
Sourcepub fn call(
&self,
method: &str,
params: &Value,
threads: Option<usize>,
) -> Result<Value, CallError>
pub fn call( &self, method: &str, params: &Value, threads: Option<usize>, ) -> Result<Value, CallError>
serve と同じ method を同じプロセスの中から呼ぶ(GUI が使う)。params・result は TCP の要求と同じ JSON。
系は場に 1 つで、TCP の要求と同じく 1 つずつ順に処理する。bin(配列)を使う trace・echo は
JSON の並びで渡す。結果の配列が要るときは call_arrays。shutdown はプロセスを止めない。
Sourcepub fn call_arrays(
&self,
method: &str,
params: &Value,
threads: Option<usize>,
) -> Result<(Value, Arrays), CallError>
pub fn call_arrays( &self, method: &str, params: &Value, threads: Option<usize>, ) -> Result<(Value, Arrays), CallError>
call と同じで、結果の配列(TCP では bin で返るもの)も受け取る
Sourcepub fn call_answer(
&self,
method: &str,
params: &Value,
threads: Option<usize>,
) -> Result<(Answer, Arrays), CallError>
pub fn call_answer( &self, method: &str, params: &Value, threads: Option<usize>, ) -> Result<(Answer, Arrays), CallError>
call_arrays と同じで、結果の型が決まっている method(面の表・最適化・差し替え探索・公差・ズーム軌跡)は
JSON を通さずに型のまま返す(Answer。GUI が使う)
Sourcepub fn request(
&self,
req: Request,
threads: Option<usize>,
) -> Result<(Answer, Arrays), CallError>
pub fn request( &self, req: Request, threads: Option<usize>, ) -> Result<(Answer, Arrays), CallError>
型の要求を同じプロセスの中から渡す(JSON を通さない。GUI が使う)。答えは call_answer と同じ
Sourcepub fn preview_layout(
&self,
load: &Value,
opts: &Value,
) -> Result<Value, CallError>
pub fn preview_layout( &self, load: &Value, opts: &Value, ) -> Result<Value, CallError>
系を読んで(load と同じ params)、そのレイアウト図(layout と同じ結果)を返す。読み込んだ系は変えず、
他の要求の順番も待たない。GUI が、解析を回している間も組合せの図だけ先に描き直すのに使う
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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