Skip to main content

AutobalanceInput

Struct AutobalanceInput 

Source
#[non_exhaustive]
pub struct AutobalanceInput { pub stage: Option<String>, pub entrants: Vec<String>, pub tries: Option<u32>, pub quick: Option<u32>, pub budget: Option<u32>, pub time: Option<u64>, pub seed: Option<u64>, pub turns: Option<u32>, pub threads: Option<u32>, pub apply: bool, pub start: Vec<GameArg>, }
Expand description

What autobalance searches. A number left out is the default: the game’s for the tries (GameTools::playtest_defaults), the engine’s for the rest.

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: Option<String>

The stage, one of the game’s; needed when it has several.

§entrants: Vec<String>

The entrants that play, by name or by a group’s name; the game’s default ones if empty.

§tries: Option<u32>

How many tries of each entrant decide whether a stage is in its bands: the stage as authored and the one found play this many.

§quick: Option<u32>

The tries of each entrant in the search’s own runs, from the same first seed: a fifth of tries (at least 1) if left out.

§budget: Option<u32>

The most evaluations (each a run of every entrant’s tries), the stage as authored’s among them: 100 if left out.

§time: Option<u64>

Stop the search after this many seconds, with the best setting seen (whose run at tries still follows); no limit if left out. What it finds then depends on the machine.

§seed: Option<u64>

The first try’s seed; each next try takes the next.

§turns: Option<u32>

The turn a try stops at if it hasn’t ended.

§threads: Option<u32>

The threads to play on; one a core if left out. What it finds never depends on it.

§apply: bool

Have the game write the changed stage to its files. This writes files of the game.

§start: Vec<GameArg>

The game’s own options, in the order given.

Implementations§

Source§

impl AutobalanceInput

Source

pub fn tries(&self, defaults: &Tries) -> Tries

The tries it asks for, defaults filling in what it leaves out.

Source

pub fn settings(&self, defaults: &Tries) -> BalanceSettings

The search it asks for, defaults filling in the tries it leaves out.

Trait Implementations§

Source§

impl Clone for AutobalanceInput

Source§

fn clone(&self) -> AutobalanceInput

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AutobalanceInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AutobalanceInput

Source§

fn default() -> AutobalanceInput

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AutobalanceInput

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for AutobalanceInput

Source§

impl JsonSchema for AutobalanceInput

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for AutobalanceInput

Source§

fn eq(&self, other: &AutobalanceInput) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AutobalanceInput

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AutobalanceInput

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.