Exemple #1
0
        self.patchedStateSequence.append(s)

    def purgeFactsWithSymbol(self, symbol):
        #In order to log the change, create a state
        # with facts that match symbol
        # remove from both true set and false set
        s = State()
        s.patch(self.initState)
        self.patchSequence.append("Purge symbol: " + symbol)
        self.patchedStateSequence.append(s)

        for prop in s.getTrueProps():
            if symbol in prop:
                self.initState.removeTrueProp(prop)

        for prop in s.getFalseProps():
            if symbol in prop:
                self.initState.removeFalseProp()


if __name__ == "__main__":
    myPDDL = InitFileMgr("/tmp/test2.out")
    op = OutputParser("/tmp/test.out")
    pset = op.getPropSet()
    print "\n\nAll props:"
    print str(pset)
    myPDDL.printInitState()
    myPDDL.patchInitState(op.stateList[2], pset)
    print "After patch:"
    myPDDL.printInitState()
    def purgeFactsWithSymbol(self, symbol):
        #In order to log the change, create a state
        # with facts that match symbol
        # remove from both true set and false set
        s = State()        
        s.patch(self.initState)
        self.patchSequence.append("Purge symbol: "+symbol)
        self.patchedStateSequence.append(s)
        
        for prop in s.getTrueProps():
            if symbol in prop:
                self.initState.removeTrueProp(prop)

        for prop in s.getFalseProps():
            if symbol in prop:
                self.initState.removeFalseProp()



if __name__ == "__main__":
    myPDDL = InitFileMgr("/tmp/test2.out")
    op = OutputParser("/tmp/test.out")
    pset = op.getPropSet()
    print "\n\nAll props:"
    print str(pset)
    myPDDL.printInitState()
    myPDDL.patchInitState(op.stateList[2], pset)
    print "After patch:"
    myPDDL.printInitState()