当前位置: 首页>>代码示例>>Python>>正文


Python glob.load_from_file函数代码示例

本文整理汇总了Python中tools.mas.glob.load_from_file函数的典型用法代码示例。如果您正苦于以下问题:Python load_from_file函数的具体用法?Python load_from_file怎么用?Python load_from_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了load_from_file函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_reachable_states_for_simple_model

 def test_reachable_states_for_simple_model(self):
     glob.load_from_file("tests/tools/ctlk/agents.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     
     true = eval_simple_expression(fsm, "TRUE")
     self.assertEqual(fsm.reachable_states, true)
开发者ID:ancailliau,项目名称:pynusmv,代码行数:7,代码来源:testMAS.py

示例2: test_constraints_post

 def test_constraints_post(self):
     glob.load_from_file("tests/tools/ctlk/constraints.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     
     false = eval_simple_expression(fsm, "FALSE")
     false = eval_simple_expression(fsm, "TRUE")
     p = eval_simple_expression(fsm, "p")
     q = eval_simple_expression(fsm, "q")
     a = eval_simple_expression(fsm, "a")
     
     self.assertEqual(1, fsm.count_states(fsm.init))
     self.assertEqual(2, fsm.count_states(fsm.post(fsm.init)))
     self.assertEqual(1, fsm.count_states(p & q))
     self.assertEqual(1, fsm.count_states(p & ~q))
     self.assertEqual(1, fsm.count_states(~p & q))
     self.assertEqual(1, fsm.count_states(~p & ~q))
     
     self.assertEqual(2, fsm.count_states(fsm.post(p & q)))
     self.assertEqual(1, fsm.count_states(fsm.post(p & ~q)))
     self.assertEqual(1, fsm.count_states(fsm.post(~p & q)))
     self.assertEqual(1, fsm.count_states(fsm.post(p & q, a)))
     self.assertEqual(0, fsm.count_states(fsm.post(p & ~q, ~a)))
     self.assertEqual(0, fsm.count_states(fsm.post(~p & q, a)))
     self.assertEqual(1, fsm.count_states(fsm.post(~p & q, ~a)))
开发者ID:ancailliau,项目名称:pynusmv,代码行数:25,代码来源:testMAS.py

示例3: test_dining_crypto

 def test_dining_crypto(self):
     glob.load_from_file("tests/tools/ctlk/dining-crypto.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     
     agents = fsm._epistemic.keys()
     self.assertSetEqual(set(agents), {"c1", "c2", "c3"})
开发者ID:ancailliau,项目名称:pynusmv,代码行数:7,代码来源:testGlob.py

示例4: test_cardgame_with_agents

 def test_cardgame_with_agents(self):
     glob.load_from_file("tests/tools/mas/cardgame.smv")
     agents = (Agent("player", {"step", "pcard", "ddcard"},
                     {"player.action"}),
               Agent("dealer", {"step", "pcard", "dcard"},
                     {"dealer.action"}))
     fsm = glob.mas(agents=agents)
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:9,代码来源:testMAS.py

示例5: test_simple_pre

 def test_simple_pre(self):
     glob.load_from_file("tests/tools/ctlk/agents.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     
     lt = eval_simple_expression(fsm, "at.local")
     lf = eval_simple_expression(fsm, "af.local")
     g = eval_simple_expression(fsm, "global")
     true = eval_simple_expression(fsm, "TRUE")
     false = eval_simple_expression(fsm, "FALSE")
     
     self.assertEqual(fsm.pre(lt & ~lf & ~g),
                      (lt & lf & ~g) | (~lt & ~lf & g))
     self.assertEqual(fsm.pre(g), true)
     self.assertEqual(fsm.pre(lf), lf.iff(g))
开发者ID:ancailliau,项目名称:pynusmv,代码行数:15,代码来源:testMAS.py

示例6: test_d_distributedmodel

 def test_d_distributedmodel(self):  
     glob.load_from_file("tests/tools/ctlk/distributed_knowledge.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     
     l1 = eval_simple_expression(fsm, "a1.local")
     l2 = eval_simple_expression(fsm, "a2.local")
     l3 = eval_simple_expression(fsm, "a3.local")
     true = eval_simple_expression(fsm, "TRUE")
     false = eval_simple_expression(fsm, "FALSE")
     
     specs = parseCTLK("'a1.local' -> D<'a1','a2'> 'a1.local'")
     self.assertEqual(len(specs), 1)
     spec = specs[0]
     a1da1 = evalCTLK(fsm, spec)        
     self.assertEqual(true, a1da1)
开发者ID:ancailliau,项目名称:pynusmv,代码行数:16,代码来源:testEval.py

示例7: test_next_state_without_inputs

 def test_next_state_without_inputs(self):
     glob.load_from_file("tests/pynusmv/models/modules.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     c2p = eval_simple_expression(fsm, "top")
     (inputs, state) = choose_next_state(fsm, fsm.pick_one_state(fsm.init))
     
     print()
     if state is None:
         print("No chosen state.")
     else:
         if inputs is not None:
             values = inputs.get_str_values()
             for var in values:
                 print(var, "=", values[var])
             print("-" * 40)
         values = state.get_str_values()
         for var in values:
             print(var, "=", values[var])
开发者ID:ancailliau,项目名称:pynusmv,代码行数:19,代码来源:testStateChoice.py

示例8: do_model

 def do_model(self, arg):
     if "model" not in self.argparsers:
         self.parse_model()
     
     # Handle arguments parsing errors
     try:
         args = self.argparsers["model"].parse_args(self._split_escaped(arg))
     except ArgumentParsingError as err:
         print(err, end="")
         return False
     
     # Error if
     #   showing path or content when nothing is read
     #   reading a file when one is already read
     
     if (args.content or args.path is None) and self.model is None:
         print("No read model.")
         return False
     
     if args.path is not None and self.model is not None:
         print("model: error: a model is already read from", self.model.path)
         return False
         
     if args.path is None:
         print("read model:", self.model.path)
         
     if args.content:
         print(self.model.content)
         
     if args.path is not None:
         try:
             f = open(args.path, 'r')
             content = f.read()
             f.close()
             glob.load_from_file(args.path)
             self.fsm = glob.mas()
             self.model = Model(args.path, content)
         except PyNuSMVError as err:
             print("model: error:", err)
         except IOError as err:
             print("model: error:", err)
开发者ID:ancailliau,项目名称:pynusmv,代码行数:41,代码来源:cmd.py

示例9: model

 def model(self):
     glob.load_from_file("tests/tools/ctlk/dining-crypto.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:5,代码来源:testExplain.py

示例10: simplemodel

 def simplemodel(self):
     glob.load_from_file("tests/tools/ctlk/agents.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:5,代码来源:testExplain.py

示例11: transmission_fair

 def transmission_fair(self):
     glob.load_from_file("tests/tools/atlkFO/models/transmission-fair.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:5,代码来源:testEval.py

示例12: cardgame_fair

 def cardgame_fair(self):
     glob.load_from_file("tests/tools/atlkFO/models/cardgame-fair.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:5,代码来源:testEval.py

示例13: little

 def little(self):
     glob.load_from_file("tests/tools/atlkPO/models/little.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:5,代码来源:testCheckIndividualPartialSI.py

示例14: transmission_with_knowledge

 def transmission_with_knowledge(self):
     glob.load_from_file(
                     "tests/tools/atlkPO/models/transmission-knowledge.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:6,代码来源:testCheckIndividualPartialSI.py

示例15: tictactoe

 def tictactoe(self):
     glob.load_from_file("tests/tools/atl/models/tictactoe.smv")
     fsm = glob.mas()
     self.assertIsNotNone(fsm)
     return fsm
开发者ID:ancailliau,项目名称:pynusmv,代码行数:5,代码来源:testCheck.py


注:本文中的tools.mas.glob.load_from_file函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。