Beispiel #1
0
def AnalyseStatePath(state):
    answer = []
    NextStateIds = DiagnoserFunctions.GetNextStatesInID(state)
    status = False

    while status != True:
        for each in NextStateIds:
            NextStateNames = str(
                DiagnoserFunctions.GetNextStatesInNames(str(each)))

            if DiagnoserFunctions.IsCertain(NextStateNames) == True:
                status = True
                answer.append(1)
            else:
                if DiagnoserFunctions.IsOnlySelfloop(each) == 1:
                    status = True
                    answer.append(0)
                else:
                    state_id = DiagnoserFunctions.GetNextStatesInID(each)
                    for cada in state_id:
                        if NextStateIds.__contains__(cada) == False:
                            NextStateIds.append(cada)

            if answer.__contains__(0) == True:
                resposta_final = 0
            else:
                resposta_final = 1

    return (resposta_final)
Beispiel #2
0
def Build(state):
    aux = []
    aux.append(state)
    for cada in aux:
        FS = Step1(state)
        aux = []
        for each in FS:
            eachname = DiagnoserFunctions.GetNextStatesInNames(str(each))
            if DiagnoserFunctions.IsNormal(eachname) == True:
                if DiagnoserFunctions.IsOnlySelfloop(each) == 0:
                    x = Step1(each)
                    for cada in x:
                        FS.append(str(cada))
            elif DiagnoserFunctions.IsCertain(eachname) == True:
                FCs.append(str(each))
            elif DiagnoserFunctions.IsUncertain(eachname) == True:
                FUax.append(str(each))