Beispiel #1
0
    def removeNode(self, pomset, node, maintainTransitivity=False):
        if maintainTransitivity:
            raise NotImplementedError

        # first remove all the incoming and outgoing connections
        filter = FilterModule.constructOrFilter()
        filter.addFilter(
            RelationalModule.ColumnValueFilter(
                'source node',
                FilterModule.IdentityFilter(node)
                )
            )
        filter.addFilter(
            RelationalModule.ColumnValueFilter(
                'target node',
                FilterModule.IdentityFilter(node)
                )
            )
        
        columns = ['source node', 'source parameter',
                   'target node', 'target parameter']
        rowValueList = [x for x in 
                pomset.parameterConnectionPathTable().retrieve(
                filter=filter, columns=columns)]

        for rowValues in rowValueList:
            self.disconnect(pomset, *rowValues)
            pass

        pomset.removeNode(node)

        return
Beispiel #2
0
def getBootstrapLoaderPomsetsFilter():
    # we need to filter out the bootstrap pomset loaders
    # because it should not be loaded again
    bootstrapLoaderFilter = FilterModule.constructOrFilter()
    bootstrapLoaderFilter.addFilter(
        RelationalModule.ColumnValueFilter(
            'definition',
            FilterModule.IdFilter(ID_LOADLIBRARYDEFINITION)
        )
    )
    bootstrapLoaderFilter.addFilter(
        RelationalModule.ColumnValueFilter(
            'definition',
            FilterModule.IdFilter(ID_BOOTSTRAPLOADER)
        )
    )
    return bootstrapLoaderFilter
Beispiel #3
0
    def removePomsetParameter(self, pomset, parameterName):

        if parameterName in [DefinitionModule.Definition.SYMBOL_INPUT_TEMPORAL,
                             DefinitionModule.Definition.SYMBOL_OUTPUT_TEMPORAL]:
            raise ValueError('cannot remove parameters defined by the system')


        parameterOrderings = pomset.parameterOrderingTable()
        filter = FilterModule.constructOrFilter()
        filter.addFilter(
            RelationalModule.ColumnValueFilter(
                'source',
                FilterModule.EquivalenceFilter(parameterName)))
        filter.addFilter(
            RelationalModule.ColumnValueFilter(
                'target',
                FilterModule.EquivalenceFilter(parameterName)))
        parameterOrderings.removeRows(filter)

        parameter = pomset.getParameter(parameterName)
        pomset.removeParameter(parameter)
        return
Beispiel #4
0
 def getEdgeFilter(self):
     theFilter = FilterModule.constructOrFilter()
     theFilter.addFilter(self.incomingEdgeFilter())
     theFilter.addFilter(self.outgoingEdgeFilter())
     return theFilter