Search in sources :

Example 1 with Dijkstra

use of examples.alloy.Dijkstra in project org.alloytools.alloy by AlloyTools.

the class ExamplesTest method testDijkstra.

/**
 * Runs the Dijkstra example for 6 States, 6 Processes, and 6 Mutexes.
 */
public void testDijkstra() {
    final Dijkstra prob = new Dijkstra();
    final Solution sol = solve(prob.checkDijkstraPreventsDeadlocks(), prob.bounds(6, 6, 6));
    check(prob.getClass().getSimpleName(), sol, UNSATISFIABLE, 444, 4341, 18485);
}
Also used : Solution(kodkod.engine.Solution) Dijkstra(examples.alloy.Dijkstra)

Example 2 with Dijkstra

use of examples.alloy.Dijkstra in project org.alloytools.alloy by AlloyTools.

the class EnumerationTest method testDijkstra.

public final void testDijkstra() {
    final Dijkstra model = new Dijkstra();
    final Formula f = model.showDijkstra();
    Iterator<Solution> sol = solver.solveAll(f, model.bounds(5, 2, 2));
    // has more than one instance
    assertNotNull(sol.next().instance());
    assertNotNull(sol.next().instance());
    assertTrue(sol.hasNext());
}
Also used : Formula(kodkod.ast.Formula) Solution(kodkod.engine.Solution) Dijkstra(examples.alloy.Dijkstra)

Aggregations

Dijkstra (examples.alloy.Dijkstra)2 Solution (kodkod.engine.Solution)2 Formula (kodkod.ast.Formula)1