Skip to main content

Candidate

Struct Candidate 

Source
pub struct Candidate {
Show 14 fields pub article: &'static str, pub gearbox: String, pub drive: &'static str, pub supply: &'static str, pub axis: String, pub motor: String, pub mass: f64, pub cost: f64, pub parts: Vec<(String, f64)>, pub price: Option<f64>, pub result: Option<(CycleLoad, Vec<Verdict>)>, pub refused: &'static str, pub duties: Vec<(f64, CycleLoad)>, pub figures: Option<Figures>,
}
Expand description

One combination of parts tried on a machine’s cycle: a motor with its drive, with or without a gearbox, on the config’s axis or one of the catalogue’s.

Fields§

§article: &'static str

“” for an axis ruled out before any motor was tried on it.

§gearbox: String

The gearbox as apply_gearbox names it; “” where the config’s own gearbox stayed.

§drive: &'static str

The drive the catalogue pairs with the motor (paired_drive); “” where there is none, and the config’s stayed.

§supply: &'static str

The supply the motor was tried at (SUPPLIES, which says the maker: vendor_of); “” for a refused axis.

§axis: String

The axis of the catalogue the motor was tried on; “” for the config’s own.

§motor: String

The one motor the candidate is for (search_motor, its id); “” for every motor that takes the shared one.

§mass: f64

Motor and gearbox of one drive axis, kg.

§cost: f64

The stand-in for the price, which no catalogue file has: the installed weight of everything the combination names, kg. Motor and gearbox times the number of motors that take it (not those with a motor of their own, [motor.<id>] or [parts.<id>]; one for search_motor), and the axis at the config’s strokes.

§parts: Vec<(String, f64)>

The parts the combination buys, as the search’s table spells them, with how many of each: every motor’s motor, gearbox and drive (the candidate’s where it takes the shared ones, its own [parts.<id>] where it has them; none where the config has hand-entered values), the axis and the belt; the parts a config keeps are named too. For one motor (search_motor) that motor’s alone. Empty for an axis ruled out before any motor was tried.

§price: Option<f64>

The user’s price for parts (apply_prices); None without a price list or where a part has no price in it.

§result: Option<(CycleLoad, Vec<Verdict>)>

The cycle and its verdicts; None where the cycle was not run, with the reason in refused. With a duty mix (Options::duties) the first duty’s cycle and the verdicts of the mix (search::mix_verdicts).

§refused: &'static str§duties: Vec<(f64, CycleLoad)>

With a duty mix: each duty’s weight and cycle, in the order of Options::duties; empty for one cycle.

§figures: Option<Figures>

The figures of the search’s table (search::Figures), where the cycle ran.

Implementations§

Source§

impl Candidate

Source

pub fn passes(&self) -> bool

Source

pub fn tightest(&self) -> Option<(&'static str, f64)>

The check closest to (or furthest beyond) its limit, with value over limit (analysis::utilisation: for a life limit over value). The belt’s slack does not count while it passes. Two checks of the DC link do not count while they pass, because their ratio is no measure of how close the cycle is to failing: with a braking resistor behind them the capacitors fill to their limit by design, in every cycle that brakes hard enough, and the resistor’s checks say what that costs; and the voltage is never below the bus, so its ratio to the trip level starts at 0.6 or so. Nor does the warm start’s convergence while it passes: it says how well the run was measured, not how close a part is to its limit.

A run whose drives tripped is infinitely far beyond: its figures end at the trip, where the DC link was just past its limit, and by that ratio it would rank as the nearest to passing. For one motor (search_motor, motor) only its own checks count, and those of the whole machine where they fail: the other motors’ are the config’s, and a check of the whole machine mostly theirs.

Trait Implementations§

Source§

impl Clone for Candidate

Source§

fn clone(&self) -> Candidate

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 Candidate

Source§

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

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

impl Default for Candidate

Source§

fn default() -> Candidate

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

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> 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.