pub struct FactorSpec {
pub target: FactorTarget,
pub levels: LevelSpec,
}Expand description
A factor as a spec writes it.
Fields§
§target: FactorTargetParameter or action tick the factor varies.
levels: LevelSpecLevels the factor takes, as written.
Implementations§
Source§impl FactorSpec
impl FactorSpec
Sourcepub fn param(id: impl Into<String>, levels: LevelSpec) -> Self
pub fn param(id: impl Into<String>, levels: LevelSpec) -> Self
Returns a factor over parameter id.
Sourcepub fn action(name: impl Into<String>, levels: LevelSpec) -> Self
pub fn action(name: impl Into<String>, levels: LevelSpec) -> Self
Returns a factor over the tick of the action named name.
Sourcepub fn resolve(
&self,
params: &[ParamDescriptor],
actions: &[ActionSpec],
design: &DesignKind,
) -> Result<Factor, FactorError>
pub fn resolve( &self, params: &[ParamDescriptor], actions: &[ActionSpec], design: &DesignKind, ) -> Result<Factor, FactorError>
Resolves the target against params and actions, and checks every level against the target.
In a random or Latin hypercube design, a range with no step stands for every value from min to max.
Everywhere else the factor lists its levels.
§Errors
Returns FactorError for a parameter or action the sweep does not have, levels the target cannot take, or
a level the target rejects.
Sourcepub fn resolve_sampled(
&self,
params: &[ParamDescriptor],
actions: &[ActionSpec],
) -> Result<Factor, FactorError>
pub fn resolve_sampled( &self, params: &[ParamDescriptor], actions: &[ActionSpec], ) -> Result<Factor, FactorError>
Resolves the factor as Self::resolve does for a random or Latin hypercube design.
§Errors
Returns FactorError for a parameter or action the sweep does not have, levels the target cannot take, or
a level the target rejects.