Developing New Components¶
The dwave-hybrid framework enables you to build your own components to incorporate into your workflow.
The key superclass is the
Runnable class: all basic components—samplers,
decomposers, composers—and flow-structuring components such as branches inherit
from this class. A
Runnable is run for an iteration in which it updates
State it receives. Typical methods are run or next to execute an
iteration and stop to terminate the
The Primitives and Flow Structuring sections describe, respectively, the basic
classes (building blocks) and flow-structuring ones and their methods. If you are
implementing these methods for your own
Runnable class, see comments in
The Racing Branches graphic below shows the top-down composition (tree structure) of a hybrid loop.
Minimal checks of workflow construction (composition of
Runnable classes declare state traits requirements that are
either independent (for simple ones) or derived from a child workflow. Traits of a new
Runnable must be expressed and modified at construction time by its parent.
When developing new
Runnable classes, constructing composite traits can be
nontrivial for some advanced flow-control runnables.
The Utilities section provides a list of useful utility methods.