#[non_exhaustive]pub struct Tunable<S> {
pub stage: S,
pub knobs: Vec<Box<dyn Knob<S>>>,
pub play: StagePlay<S>,
pub write: StageWrite<S>,
}Expand description
The stage an AutobalancePlan may change, of the game’s stage
definition type S: the command never sees S, only what the search
found (TunableStage). Build it with Tunable::new (ADR-0039).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.stage: SThe stage as authored.
knobs: Vec<Box<dyn Knob<S>>>What the search may change, in the order it tries them.
play: StagePlay<S>One try on a stage: the stage (as authored, or changed by the
knobs), the entrant at that index of the plan’s entrants, the seed,
the turn it stops at. Tries run on several threads at once, in any
order; most simply
play_try.
write: StageWrite<S>Writes a changed stage back to the game’s files (--apply): the
files written, as the game shows them.
Implementations§
Trait Implementations§
Source§impl<S: Clone + Sync> TunableStage for Tunable<S>
impl<S: Clone + Sync> TunableStage for Tunable<S>
Source§fn search(
&self,
settings: &BalanceSettings,
evaluate: &mut Evaluate<'_>,
should_stop: &mut dyn FnMut() -> bool,
apply: bool,
) -> Result<Searched, String>
fn search( &self, settings: &BalanceSettings, evaluate: &mut Evaluate<'_>, should_stop: &mut dyn FnMut() -> bool, apply: bool, ) -> Result<Searched, String>
The search over the stage (
shuyi_core::autobalance_by) as
settings say, each setting played by evaluate, asking
should_stop before each run; with apply, the stage found is
written if it changed.Auto Trait Implementations§
impl<S> !RefUnwindSafe for Tunable<S>
impl<S> !Send for Tunable<S>
impl<S> !Sync for Tunable<S>
impl<S> !UnwindSafe for Tunable<S>
impl<S> Freeze for Tunable<S>where
S: Freeze,
impl<S> Unpin for Tunable<S>where
S: Unpin,
impl<S> UnsafeUnpin for Tunable<S>where
S: UnsafeUnpin,
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