Trait Problem

Source
pub trait Problem<T, C, D>: BaseProblem + Sync{
    // Required methods
    fn hit_cost(&self, t: i32, x: Config<T>) -> Cost<C, D>;
    fn movement(&self, prev_x: Config<T>, x: Config<T>, inverted: bool) -> N64;

    // Provided methods
    fn objective_function<'a>(&self, xs: &Schedule<T>) -> Result<Cost<C, D>>
       where T: Value<'a> { ... }
    fn inverted_objective_function<'a>(
        &self,
        xs: &Schedule<T>,
    ) -> Result<Cost<C, D>>
       where T: Value<'a> { ... }
    fn alpha_unfair_objective_function<'a>(
        &self,
        xs: &Schedule<T>,
        alpha: f64,
    ) -> Result<Cost<C, D>>
       where T: Value<'a> { ... }
    fn objective_function_with_default<'a>(
        &self,
        xs: &Schedule<T>,
        default: &Config<T>,
    ) -> Result<Cost<C, D>>
       where T: Value<'a> { ... }
    fn _objective_function_with_default<'a>(
        &self,
        xs: &Schedule<T>,
        default: &Config<T>,
        alpha: f64,
        inverted: bool,
        t_end: i32,
    ) -> Result<Cost<C, D>>
       where T: Value<'a> { ... }
    fn total_movement<'a>(
        &self,
        xs: &Schedule<T>,
        inverted: bool,
    ) -> Result<N64>
       where T: Value<'a> { ... }
    fn _default_config<'a>(&self) -> Config<T>
       where T: Value<'a> { ... }
}
Expand description

Trait providing objective function, hitting cost, and movement cost.

Required Methods§

Source

fn hit_cost(&self, t: i32, x: Config<T>) -> Cost<C, D>

Hitting cost.

Source

fn movement(&self, prev_x: Config<T>, x: Config<T>, inverted: bool) -> N64

Movement cost.

Provided Methods§

Source

fn objective_function<'a>(&self, xs: &Schedule<T>) -> Result<Cost<C, D>>
where T: Value<'a>,

Objective function. Calculates the cost of a schedule.

Source

fn inverted_objective_function<'a>( &self, xs: &Schedule<T>, ) -> Result<Cost<C, D>>
where T: Value<'a>,

Inverted Objective function. Calculates the cost of a schedule. Pays the switching cost for powering down rather than powering up.

Source

fn alpha_unfair_objective_function<'a>( &self, xs: &Schedule<T>, alpha: f64, ) -> Result<Cost<C, D>>
where T: Value<'a>,

$\alpha$-unfair Objective function. Calculates the cost of a schedule.

Source

fn objective_function_with_default<'a>( &self, xs: &Schedule<T>, default: &Config<T>, ) -> Result<Cost<C, D>>
where T: Value<'a>,

Objective function starting from an initial configuration other than $\mathbf{0}$.

Source

fn _objective_function_with_default<'a>( &self, xs: &Schedule<T>, default: &Config<T>, alpha: f64, inverted: bool, t_end: i32, ) -> Result<Cost<C, D>>
where T: Value<'a>,

Source

fn total_movement<'a>(&self, xs: &Schedule<T>, inverted: bool) -> Result<N64>
where T: Value<'a>,

Movement in the decision space.

Source

fn _default_config<'a>(&self) -> Config<T>
where T: Value<'a>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, T> Problem<T, (), DataCenterModelOutputFailure> for SmoothedLoadOptimization<T>
where T: Value<'a>,

Source§

impl<'a, T> Problem<T, DataCenterModelOutputSuccess, DataCenterModelOutputFailure> for SmoothedBalancedLoadOptimization<'a, T>
where T: Value<'a>,

Source§

impl<'a, T, C, D> Problem<T, C, D> for SimplifiedSmoothedConvexOptimization<'a, T, C, D>
where T: Value<'a>, C: ModelOutputSuccess, D: ModelOutputFailure,

Source§

impl<'a, T, C, D> Problem<T, C, D> for SmoothedConvexOptimization<'a, T, C, D>
where T: Value<'a>, C: ModelOutputSuccess, D: ModelOutputFailure,