Trait dypdl::StateInterface

source ·
pub trait StateInterface: Sized {
Show 17 methods // Required methods fn get_number_of_set_variables(&self) -> usize; fn get_set_variable(&self, i: usize) -> &Set; fn get_number_of_vector_variables(&self) -> usize; fn get_vector_variable(&self, i: usize) -> &Vector; fn get_number_of_element_variables(&self) -> usize; fn get_element_variable(&self, i: usize) -> Element; fn get_number_of_integer_variables(&self) -> usize; fn get_integer_variable(&self, i: usize) -> Integer; fn get_number_of_continuous_variables(&self) -> usize; fn get_continuous_variable(&self, i: usize) -> Continuous; fn get_number_of_element_resource_variables(&self) -> usize; fn get_element_resource_variable(&self, i: usize) -> Element; fn get_number_of_integer_resource_variables(&self) -> usize; fn get_integer_resource_variable(&self, i: usize) -> Integer; fn get_number_of_continuous_resource_variables(&self) -> usize; fn get_continuous_resource_variable(&self, i: usize) -> Continuous; // Provided method fn apply_effect<T: From<State>>( &self, effect: &Effect, registry: &TableRegistry ) -> T { ... }
}
Expand description

Trait representing a state in DyPDL.

Required Methods§

source

fn get_number_of_set_variables(&self) -> usize

Returns the number of set variables;

source

fn get_set_variable(&self, i: usize) -> &Set

Returns the value of a set variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_vector_variables(&self) -> usize

Returns the number of vector variables;

source

fn get_vector_variable(&self, i: usize) -> &Vector

Returns the value of a vector variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_element_variables(&self) -> usize

Returns the number of element variables;

source

fn get_element_variable(&self, i: usize) -> Element

Returns the value of an element variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_integer_variables(&self) -> usize

Returns the number of integer numeric variables;

source

fn get_integer_variable(&self, i: usize) -> Integer

Returns the value of an integer numeric variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_continuous_variables(&self) -> usize

Returns the number of continuous numeric variables;

source

fn get_continuous_variable(&self, i: usize) -> Continuous

Returns the value of a continuous numeric variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_element_resource_variables(&self) -> usize

Returns the number of element resource variables;

source

fn get_element_resource_variable(&self, i: usize) -> Element

Returns the value of an element resource variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_integer_resource_variables(&self) -> usize

Returns the number of integer resource variables;

source

fn get_integer_resource_variable(&self, i: usize) -> Integer

Returns the value of an integer resource variable.

§Panics

Panics if no variable has the id of i.

source

fn get_number_of_continuous_resource_variables(&self) -> usize

Returns the number of continuous resource variables;

source

fn get_continuous_resource_variable(&self, i: usize) -> Continuous

Returns the value of a continuous resource variable.

§Panics

Panics if no variable has the id of i.

Provided Methods§

source

fn apply_effect<T: From<State>>( &self, effect: &Effect, registry: &TableRegistry ) -> T

Returns the transitioned state by the effect.

Set and vector effects must be sorted by the indices of the variables.

§Panics

Panics if the cost of the transition state is used or a min/max reduce operation is performed on an empty set or vector.

Object Safety§

This trait is not object safe.

Implementors§