Esempio n. 1
0
def test_savings():
    """Check the savings (Clarke, Wright) construction method."""
    from vrptw import VrptwSolution
    sol = VrptwSolution(DummyTask())
    from pygrout import build_by_savings
    build_by_savings(sol)
    assert sol.check()
Esempio n. 2
0
def savings_val(task):
    """The mapping function for savings heuristic."""
    name, waitlimit, mi = task
    from pygrout import VrptwSolution, VrptwTask, build_by_savings
    print "Should process", name
    sol = VrptwSolution(VrptwTask(name))
    build_by_savings(sol, waitlimit, mi)
    return sol.val()