def assert_kirk_result(self, example_file, expected_result): for solver in DynamicControllability.SOLVERS: obj = Tpn.parse(join(self.examples_dir, example_file)) tpnu = Tpnu.from_tpn_autogen(obj) search_problem = SearchProblem(tpnu) search_problem.initialize() solution = search_problem.next_solution() print("----------------------------------------") if solution is not None: print(example_file) solution.pretty_print() else: print(example_file) print(None) search_problem.pretty_print() is_feasible = solution is not None self.assertEqual(is_feasible, expected_result)
__author__ = 'yupeng' from tpn import Tpn from temporal_network.tpnu import Tpnu if __name__ == '__main__': # Load the tpn from file obj = Tpn.parse(r'C:\Users\yupeng\Downloads\document.tpn') tpnu = Tpnu.from_tpn_autogen(obj)
def assert_dc_result(self, example_file, expected_result): for solver in DynamicControllability.SOLVERS: obj = Tpn.parse(join(self.examples_dir, example_file)) conflict = DynamicControllability.check(obj, solver=solver) is_dynamically_controllable = conflict is None self.assertEqual(is_dynamically_controllable, expected_result)