[][src]Module ddo::common

This module defines the most basic data types that are used throughout all the code of our library (both at the abstraction and implementation levels). These are also the types your client library is likely to work with.

In particular, this module comprises the definition of the following types:

  • Variable
  • Domain (+ associated DomainIter)
  • Decision
  • PartialAssignment (+ associated PartialAssignmentIter)
  • Solution
  • FrontierNode

In addition to the above, it also provides the definition of the following useful types:

  • VarSet (+ associated VarSetIter)
  • BitSetIter
  • LexBitSet
  • Matrix

Structs

BitSetIter

This structure defines an iterator capable of iterating over the 1-bits of a fixed bitset. It uses word representation of the items in the set, so it should be more efficient to use than a crude iteration over the elements of the set.

Decision

This denotes a decision that was made during the search. It affects a given value to the specified variable. Any given Decision should be understood as ```[[ variable = value ]]````

FrontierNode

Frontier nodes describes the subproblems that have been enumerated and must be explored in order to prove optimality. Hence, each single frontier node denotes one subproblem characterized by the same transition and transition cost functions as the original problem, but having a different initial state and value (lp_len). Because a frontier node is a subproblem, of the original constraint optimization problem, it also remembers the partial assignment (the path) which transforms the global problem into this region of the state space.

LexBitSet

A totally ordered Bitset wrapper. Useful to implement tie break mechanisms. This wrapper orders the bitsets according to the lexical order of their underlying bits.

Matrix

This structure implements a 2D matrix of size [ n X m ].

PartialAssignmentIter

This structure backs the iteration over the elements of a PartialAssignment. This is what enables the use of partial assignments in for loops.

Solution

A solution is a partial assignment that assigns a value to each of the problem variables. From the MDD-perspective, it is an optimal r-t path in the exact MDD.

VarSet

This type denotes a set of variable. It encodes them compactly as a fixed size bitset. A VarSet can be efficiently iterated upon.

VarSetIter

This type denotes the iterator used to iterate over the Variables to a given VarSet. It should never be manually instantiated, but always via the iter() method from the varset.

Variable

This type denotes a variable from the optimization problem at hand. In this case, each variable is assumed to be identified with an integer ranging from 0 until problem.nb_vars()

Enums

Domain

A domain is a set of values (isize) that may be assigned to some variable by a decision.

DomainIter

DomainIter is the type of the iterator used to go over the possible values of a domain. Therefore, it is isomorphic to the Domain type itself.

PartialAssignment

A partial assignment is an incomplete solution that can be extended into a complete one. In other words, it encapsulates a collection of decisions.