The functionalities of Asteroid are split into two main packages:
These two package come with a core, that define the framework, interfaces, etc. and a library, including a set of standard invariants or constraints to use for solving combinatorial problems.
This package is made of three architectural layers:
The library of invariants is proposed on top of the computation structure layer. It includes logic, numeric, min/max, and set invariants and can of course be extended by implementing the proper interfaces defined in the computation structure layer, typically the Invariant interface. See Invariants.Library
The constraint package adds an additional layer on top of the invariant package. It defines the Constraint and the Constraint System classes. A constraint is merely a function that computes the degree of violation of the constraint. Within the constraint, this computation is typically implemented by means of invariants to ensure that the violation is updated incrementally when neighbours are explored. Furthermore, constraints are also able to attribute a degree of violation to each of the variable they are posted on. This degree of violation can be queried through a dedicated method.
Constraint systems aim at aggregating constraints. A constraint system is a constraint, exhibiting the same violation degrees. The violation degree of the while constraint system is the sum of the violation of the constraints posted in it.
The violation degree associated with specific variables is handled differently. To have an associated violation degree, a variable must be registered to the constraint system. The constraint system sums the degree of violation, associated to each variable referenced by constraints posted in it, and whose value is derived from the registered variable. This is performed by exploring the structure of invariants posted in the model. This enables one to associate a violation degree with any variables, but this violation degree must be handled carefully, as it is not equal to a differentiation.
The search engine package provides a set of primitives generally used when implementing a search script, namely:
This package proposes a layer on top of the invariant package to solve job hop scheduling problems. It proposes concepts such as tasks, resources, schedule, etc.
Asteroid was initially built to solve a JobShop problem, so that the emphasis was not set on features that do not contribute directly to the JobShop solver. This justifies many of the features of Asteroid.