コード例 #1
0
    def test_successor_1(self):
        vehicles = [Vehicle(0)]
        packages = [Package(2, 1)]
        state = State(vehicles, packages)

        # Travel to package at position 2:
        p1 = Package(2, 1)
        p1.setCarried()
        p1.setUnDelivered()
        v1 = Vehicle(2)
        v1.addPackage(p1)
        n1 = State([v1], [])

        self.assertTrue([n1] == state.successor())
コード例 #2
0
 def test_setUnDelivered(self):
     package = Package(0, 0)
     package.setUnDelivered()
     self.assertTrue(package.isDelivered() == False)