Exemple #1
0
 def __init__(self, targetBranch, starttime):
     # traninforlist = obtain_efsm_info.obtain_tran_info()
     self.targetBranch = targetBranch
     while '.' in self.targetBranch.event:
         self.targetBranch.event = self.targetBranch.event.replace('.', '')
     while '.' in self.targetBranch.cond:
         self.targetBranch.cond = self.targetBranch.cond.replace('.', '')
     while '.' in self.targetBranch.action:
         self.targetBranch.action = self.targetBranch.action.replace(
             '.', '')
     self.targetBranchSrcList = obtain_efsm_info.getOppositeBranch(
         self.targetBranch)
     self.useList = []
     self.tranlist = []
     self.eventDefList = set
     self.sortKaiGuan = 1
     self.defPercent = config.defPercent  # event action
     self.usePercent = config.usePercent  # cond action
     self.sorttime = 0
     if self.targetBranchSrcList is not None:
         print("候选的目标分支插入点列表:%s %s") % (self.targetBranchSrcList,
                                        time.time() - starttime)
         # STATE = EFSM.State("State S6")
         # targetBranch.src = STATE
         self.targetBranch.src = self.targetBranchSrcList[0]
         self.targetBranchSrcList.pop(0)
         originTran = TranWithInfo(self.targetBranch)
         originTran.quality = 'relate'
         self.useList = list(
             set(originTran.getvUseList()) -
             set(originTran.getveventVdef()))
         self.tranlist.append(originTran)
         self.eventDefList = set(originTran.getveventVdef())
     else:
         print "目标分支无对立分支"
Exemple #2
0
 def __init__(self, targetBranch):
     # traninforlist = obtain_efsm_info.obtain_tran_info()
     self.targetBranchSrcList = obtain_efsm_info.getOppositeBranch(targetBranch)
     targetBranch.src = self.targetBranchSrcList[0]
     originTran = TranWithInfo(targetBranch)
     self.useList = originTran.getvUseList()
     self.tranlist = []
     self.tranlist.append(originTran)
     self.eventDefList = originTran.getveventVdef()
     self.kaiguan = 1 #开关,1代表优先级排序,0代码全随机