[−][src]Trait ddo::core::abstraction::dp::Problem
This is the main abstraction that should be provided by any user of our library. Indeed, it defines the problem to be solved in the form of a dynamic program. Therefore, this trait closely sticks to the formal definition of a dynamic program.
The type parameter <T>
denotes the type of the states of the dynamic program.
Required methods
fn nb_vars(&self) -> usize
Returns the number of decision variables that play a role in the problem.
fn initial_state(&self) -> T
Returns the initial state of the problem (when no decision is taken).
fn initial_value(&self) -> i32
Returns the initial value of the objective function (when no decision is taken).
fn domain_of<'a>(&self, state: &'a T, var: Variable) -> Domain<'a>
Returns the domain of variable var
in the given state
. These are the
possible values that might possibly be affected to var
when the system
has taken decisions leading to state
.
fn transition(&self, state: &T, vars: &VarSet, d: Decision) -> T
Returns the next state reached by the system if the decision d
is
taken when the system is in the given state
and the given set of vars
are still free (no value assigned).
fn transition_cost(&self, state: &T, vars: &VarSet, d: Decision) -> i32
Returns the marginal benefit (in terms of objective function to maximize)
of taking decision d
is when the system is in the given state
and
the given set of vars
are still free (no value assigned).
Provided methods
fn impacted_by(&self, state: &T, variable: Variable) -> bool
Optional method for the case where you'd want to use a pooled mdd
implementation. This method returns true iff taking a decision on
variable
might have an impact (state or longest path) on a node having
the given state
fn root_node(&self) -> Node<T>
Returns the root node of an exact MDD standing for this problem.
This method is (trivially) auto-implemented, but re-implementing it does not make much sense.
fn all_vars(&self) -> VarSet
Returns a var set with all the variables of this problem.
This method is (trivially) auto-implemented, but re-implementing it does not make much sense.
Implementors
impl<T, P, X> Problem<T> for PbRef<X, P> where
P: Problem<T>,
X: Borrow<P>,
[src]
P: Problem<T>,
X: Borrow<P>,