class CreateLinkMatr2OAF_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 15)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)
        self.LHS.merge(ASG_omacs(parent))
        self.LHS.merge(ASG_GenericGraph(parent))

        self.obj1677 = product(parent)
        self.obj1677.preAction(self.LHS.CREATE)
        self.obj1677.isGraphObjectVisual = True

        if (hasattr(self.obj1677, '_setHierarchicalLink')):
            self.obj1677._setHierarchicalLink(False)

        # MaxFlow
        self.obj1677.MaxFlow.setNone()

        # price
        self.obj1677.price.setValue(0)

        # Name
        self.obj1677.Name.setValue('')
        self.obj1677.Name.setNone()

        # ReqFlow
        self.obj1677.ReqFlow.setNone()

        self.obj1677.GGLabel.setValue(5)
        self.obj1677.graphClass_ = graph_product
        if parent.genGraphics:
            new_obj = graph_product(280.0, 220.0, self.obj1677)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1677.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1677)
        self.obj1677.postAction(self.LHS.CREATE)

        self.obj1678 = metarial(parent)
        self.obj1678.preAction(self.LHS.CREATE)
        self.obj1678.isGraphObjectVisual = True

        if (hasattr(self.obj1678, '_setHierarchicalLink')):
            self.obj1678._setHierarchicalLink(False)

        # MaxFlow
        self.obj1678.MaxFlow.setNone()

        # price
        self.obj1678.price.setValue(0)

        # Name
        self.obj1678.Name.setValue('')
        self.obj1678.Name.setNone()

        # ReqFlow
        self.obj1678.ReqFlow.setNone()

        self.obj1678.GGLabel.setValue(3)
        self.obj1678.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(320.0, 40.0, self.obj1678)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1678.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1678)
        self.obj1678.postAction(self.LHS.CREATE)

        self.obj1679 = Goal(parent)
        self.obj1679.preAction(self.LHS.CREATE)
        self.obj1679.isGraphObjectVisual = True

        if (hasattr(self.obj1679, '_setHierarchicalLink')):
            self.obj1679._setHierarchicalLink(False)

        # name
        self.obj1679.name.setValue('')
        self.obj1679.name.setNone()

        self.obj1679.GGLabel.setValue(2)
        self.obj1679.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(180.0, 60.0, self.obj1679)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1679.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1679)
        self.obj1679.postAction(self.LHS.CREATE)

        self.obj1680 = GenericGraphEdge(parent)
        self.obj1680.preAction(self.LHS.CREATE)
        self.obj1680.isGraphObjectVisual = True

        if (hasattr(self.obj1680, '_setHierarchicalLink')):
            self.obj1680._setHierarchicalLink(False)

        self.obj1680.GGLabel.setValue(4)
        self.obj1680.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(264.5, 71.5, self.obj1680)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1680.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1680)
        self.obj1680.postAction(self.LHS.CREATE)

        self.obj1679.out_connections_.append(self.obj1680)
        self.obj1680.in_connections_.append(self.obj1679)
        self.obj1679.graphObject_.pendingConnections.append(
            (self.obj1679.graphObject_.tag, self.obj1680.graphObject_.tag,
             [203.0, 61.0, 264.5, 71.5], 0, True))
        self.obj1680.out_connections_.append(self.obj1678)
        self.obj1678.in_connections_.append(self.obj1680)
        self.obj1680.graphObject_.pendingConnections.append(
            (self.obj1680.graphObject_.tag, self.obj1678.graphObject_.tag,
             [326.0, 82.0, 264.5, 71.5], 0, True))

        self.RHS = ASG_pns(parent)
        self.RHS.merge(ASG_omacs(parent))
        self.RHS.merge(ASG_GenericGraph(parent))

        self.obj1684 = product(parent)
        self.obj1684.preAction(self.RHS.CREATE)
        self.obj1684.isGraphObjectVisual = True

        if (hasattr(self.obj1684, '_setHierarchicalLink')):
            self.obj1684._setHierarchicalLink(False)

        # MaxFlow
        self.obj1684.MaxFlow.setNone()

        # price
        self.obj1684.price.setValue(0)

        # Name
        self.obj1684.Name.setValue('')
        self.obj1684.Name.setNone()

        # ReqFlow
        self.obj1684.ReqFlow.setNone()

        self.obj1684.GGLabel.setValue(5)
        self.obj1684.graphClass_ = graph_product
        if parent.genGraphics:
            new_obj = graph_product(280.0, 220.0, self.obj1684)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1684.graphObject_ = new_obj
        self.obj16840 = AttrCalc()
        self.obj16840.Copy = ATOM3Boolean()
        self.obj16840.Copy.setValue(('Copy from LHS', 1))
        self.obj16840.Copy.config = 0
        self.obj16840.Specify = ATOM3Constraint()
        self.obj16840.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1684.GGset2Any['MaxFlow'] = self.obj16840
        self.obj16841 = AttrCalc()
        self.obj16841.Copy = ATOM3Boolean()
        self.obj16841.Copy.setValue(('Copy from LHS', 1))
        self.obj16841.Copy.config = 0
        self.obj16841.Specify = ATOM3Constraint()
        self.obj16841.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1684.GGset2Any['Name'] = self.obj16841
        self.obj16842 = AttrCalc()
        self.obj16842.Copy = ATOM3Boolean()
        self.obj16842.Copy.setValue(('Copy from LHS', 1))
        self.obj16842.Copy.config = 0
        self.obj16842.Specify = ATOM3Constraint()
        self.obj16842.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1684.GGset2Any['ReqFlow'] = self.obj16842

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1684)
        self.obj1684.postAction(self.RHS.CREATE)

        self.obj1685 = metarial(parent)
        self.obj1685.preAction(self.RHS.CREATE)
        self.obj1685.isGraphObjectVisual = True

        if (hasattr(self.obj1685, '_setHierarchicalLink')):
            self.obj1685._setHierarchicalLink(False)

        # MaxFlow
        self.obj1685.MaxFlow.setNone()

        # price
        self.obj1685.price.setValue(0)

        # Name
        self.obj1685.Name.setValue('')
        self.obj1685.Name.setNone()

        # ReqFlow
        self.obj1685.ReqFlow.setNone()

        self.obj1685.GGLabel.setValue(3)
        self.obj1685.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(320.0, 40.0, self.obj1685)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1685.graphObject_ = new_obj
        self.obj16850 = AttrCalc()
        self.obj16850.Copy = ATOM3Boolean()
        self.obj16850.Copy.setValue(('Copy from LHS', 1))
        self.obj16850.Copy.config = 0
        self.obj16850.Specify = ATOM3Constraint()
        self.obj16850.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1685.GGset2Any['MaxFlow'] = self.obj16850
        self.obj16851 = AttrCalc()
        self.obj16851.Copy = ATOM3Boolean()
        self.obj16851.Copy.setValue(('Copy from LHS', 1))
        self.obj16851.Copy.config = 0
        self.obj16851.Specify = ATOM3Constraint()
        self.obj16851.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1685.GGset2Any['Name'] = self.obj16851
        self.obj16852 = AttrCalc()
        self.obj16852.Copy = ATOM3Boolean()
        self.obj16852.Copy.setValue(('Copy from LHS', 1))
        self.obj16852.Copy.config = 0
        self.obj16852.Specify = ATOM3Constraint()
        self.obj16852.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1685.GGset2Any['ReqFlow'] = self.obj16852

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1685)
        self.obj1685.postAction(self.RHS.CREATE)

        self.obj1686 = operatingUnit(parent)
        self.obj1686.preAction(self.RHS.CREATE)
        self.obj1686.isGraphObjectVisual = True

        if (hasattr(self.obj1686, '_setHierarchicalLink')):
            self.obj1686._setHierarchicalLink(False)

        # OperCostProp
        self.obj1686.OperCostProp.setValue(1.0)

        # name
        self.obj1686.name.setValue('')
        self.obj1686.name.setNone()

        # OperCostFix
        self.obj1686.OperCostFix.setValue(2.0)

        self.obj1686.GGLabel.setValue(7)
        self.obj1686.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(320.0, 140.0, self.obj1686)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1686.graphObject_ = new_obj
        self.obj16860 = AttrCalc()
        self.obj16860.Copy = ATOM3Boolean()
        self.obj16860.Copy.setValue(('Copy from LHS', 0))
        self.obj16860.Copy.config = 0
        self.obj16860.Specify = ATOM3Constraint()
        self.obj16860.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1686.GGset2Any['OperCostProp'] = self.obj16860
        self.obj16861 = AttrCalc()
        self.obj16861.Copy = ATOM3Boolean()
        self.obj16861.Copy.setValue(('Copy from LHS', 0))
        self.obj16861.Copy.config = 0
        self.obj16861.Specify = ATOM3Constraint()
        self.obj16861.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
             'return self.getMatched(graphID, self.LHS.nodeWithLabel(2)).name.getValue()+\' OAF\'\n'
             ))
        self.obj1686.GGset2Any['name'] = self.obj16861
        self.obj16862 = AttrCalc()
        self.obj16862.Copy = ATOM3Boolean()
        self.obj16862.Copy.setValue(('Copy from LHS', 0))
        self.obj16862.Copy.config = 0
        self.obj16862.Specify = ATOM3Constraint()
        self.obj16862.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1686.GGset2Any['OperCostFix'] = self.obj16862

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1686)
        self.obj1686.postAction(self.RHS.CREATE)

        self.obj1687 = intoProduct(parent)
        self.obj1687.preAction(self.RHS.CREATE)
        self.obj1687.isGraphObjectVisual = True

        if (hasattr(self.obj1687, '_setHierarchicalLink')):
            self.obj1687._setHierarchicalLink(False)

        # rate
        self.obj1687.rate.setValue(1.0)

        self.obj1687.GGLabel.setValue(9)
        self.obj1687.graphClass_ = graph_intoProduct
        if parent.genGraphics:
            new_obj = graph_intoProduct(322.0, 179.0, self.obj1687)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1687.graphObject_ = new_obj
        self.obj16870 = AttrCalc()
        self.obj16870.Copy = ATOM3Boolean()
        self.obj16870.Copy.setValue(('Copy from LHS', 0))
        self.obj16870.Copy.config = 0
        self.obj16870.Specify = ATOM3Constraint()
        self.obj16870.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1687.GGset2Any['rate'] = self.obj16870

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1687)
        self.obj1687.postAction(self.RHS.CREATE)

        self.obj1688 = fromMaterial(parent)
        self.obj1688.preAction(self.RHS.CREATE)
        self.obj1688.isGraphObjectVisual = True

        if (hasattr(self.obj1688, '_setHierarchicalLink')):
            self.obj1688._setHierarchicalLink(False)

        # rate
        self.obj1688.rate.setValue(1.0)

        self.obj1688.GGLabel.setValue(8)
        self.obj1688.graphClass_ = graph_fromMaterial
        if parent.genGraphics:
            new_obj = graph_fromMaterial(342.0, 110.0, self.obj1688)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1688.graphObject_ = new_obj
        self.obj16880 = AttrCalc()
        self.obj16880.Copy = ATOM3Boolean()
        self.obj16880.Copy.setValue(('Copy from LHS', 0))
        self.obj16880.Copy.config = 0
        self.obj16880.Specify = ATOM3Constraint()
        self.obj16880.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1688.GGset2Any['rate'] = self.obj16880

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1688)
        self.obj1688.postAction(self.RHS.CREATE)

        self.obj1689 = Goal(parent)
        self.obj1689.preAction(self.RHS.CREATE)
        self.obj1689.isGraphObjectVisual = True

        if (hasattr(self.obj1689, '_setHierarchicalLink')):
            self.obj1689._setHierarchicalLink(False)

        # name
        self.obj1689.name.setValue('')
        self.obj1689.name.setNone()

        self.obj1689.GGLabel.setValue(2)
        self.obj1689.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(180.0, 60.0, self.obj1689)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1689.graphObject_ = new_obj
        self.obj16890 = AttrCalc()
        self.obj16890.Copy = ATOM3Boolean()
        self.obj16890.Copy.setValue(('Copy from LHS', 1))
        self.obj16890.Copy.config = 0
        self.obj16890.Specify = ATOM3Constraint()
        self.obj16890.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1689.GGset2Any['name'] = self.obj16890

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1689)
        self.obj1689.postAction(self.RHS.CREATE)

        self.obj1690 = GenericGraphEdge(parent)
        self.obj1690.preAction(self.RHS.CREATE)
        self.obj1690.isGraphObjectVisual = True

        if (hasattr(self.obj1690, '_setHierarchicalLink')):
            self.obj1690._setHierarchicalLink(False)

        self.obj1690.GGLabel.setValue(4)
        self.obj1690.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(264.5, 71.5, self.obj1690)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1690.graphObject_ = new_obj

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1690)
        self.obj1690.postAction(self.RHS.CREATE)

        self.obj1685.out_connections_.append(self.obj1688)
        self.obj1688.in_connections_.append(self.obj1685)
        self.obj1685.graphObject_.pendingConnections.append(
            (self.obj1685.graphObject_.tag, self.obj1688.graphObject_.tag,
             [244.0, 89.0, 342.0, 110.0], 0, True))
        self.obj1686.out_connections_.append(self.obj1687)
        self.obj1687.in_connections_.append(self.obj1686)
        self.obj1686.graphObject_.pendingConnections.append(
            (self.obj1686.graphObject_.tag, self.obj1687.graphObject_.tag,
             [339.0, 158.0, 322.0, 179.0], 0, True))
        self.obj1687.out_connections_.append(self.obj1684)
        self.obj1684.in_connections_.append(self.obj1687)
        self.obj1687.graphObject_.pendingConnections.append(
            (self.obj1687.graphObject_.tag, self.obj1684.graphObject_.tag,
             [305.0, 220.0, 322.0, 179.0], 0, True))
        self.obj1688.out_connections_.append(self.obj1686)
        self.obj1686.in_connections_.append(self.obj1688)
        self.obj1688.graphObject_.pendingConnections.append(
            (self.obj1688.graphObject_.tag, self.obj1686.graphObject_.tag,
             [340.0, 151.0, 342.0, 110.0], 0, True))
        self.obj1689.out_connections_.append(self.obj1690)
        self.obj1690.in_connections_.append(self.obj1689)
        self.obj1689.graphObject_.pendingConnections.append(
            (self.obj1689.graphObject_.tag, self.obj1690.graphObject_.tag,
             [93.0, 61.0, 264.5, 71.5], 2, 0))
        self.obj1690.out_connections_.append(self.obj1685)
        self.obj1685.in_connections_.append(self.obj1690)
        self.obj1690.graphObject_.pendingConnections.append(
            (self.obj1690.graphObject_.tag, self.obj1685.graphObject_.tag,
             [226.0, 82.0, 264.5, 71.5], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        return not hasattr(node, "link2oaf")

    def action(self, graphID, isograph, atom3i):
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        node.link2oaf = True
示例#2
0
class RemoveGoal_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 25)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)
        self.LHS.merge(ASG_omacs(parent))
        self.LHS.merge(ASG_GenericGraph(parent))

        self.obj1815 = metarial(parent)
        self.obj1815.preAction(self.LHS.CREATE)
        self.obj1815.isGraphObjectVisual = True

        if (hasattr(self.obj1815, '_setHierarchicalLink')):
            self.obj1815._setHierarchicalLink(False)

        # MaxFlow
        self.obj1815.MaxFlow.setNone()

        # price
        self.obj1815.price.setValue(0)

        # Name
        self.obj1815.Name.setValue('')
        self.obj1815.Name.setNone()

        # ReqFlow
        self.obj1815.ReqFlow.setNone()

        self.obj1815.GGLabel.setValue(1)
        self.obj1815.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(280.0, 60.0, self.obj1815)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1815.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1815)
        self.obj1815.postAction(self.LHS.CREATE)

        self.obj1816 = Goal(parent)
        self.obj1816.preAction(self.LHS.CREATE)
        self.obj1816.isGraphObjectVisual = True

        if (hasattr(self.obj1816, '_setHierarchicalLink')):
            self.obj1816._setHierarchicalLink(False)

        # name
        self.obj1816.name.setValue('')
        self.obj1816.name.setNone()

        self.obj1816.GGLabel.setValue(3)
        self.obj1816.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(100.0, 60.0, self.obj1816)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1816.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1816)
        self.obj1816.postAction(self.LHS.CREATE)

        self.obj1817 = GenericGraphEdge(parent)
        self.obj1817.preAction(self.LHS.CREATE)
        self.obj1817.isGraphObjectVisual = True

        if (hasattr(self.obj1817, '_setHierarchicalLink')):
            self.obj1817._setHierarchicalLink(False)

        self.obj1817.GGLabel.setValue(4)
        self.obj1817.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(205.0, 106.0, self.obj1817)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1817.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1817)
        self.obj1817.postAction(self.LHS.CREATE)

        self.obj1816.out_connections_.append(self.obj1817)
        self.obj1817.in_connections_.append(self.obj1816)
        self.obj1816.graphObject_.pendingConnections.append(
            (self.obj1816.graphObject_.tag, self.obj1817.graphObject_.tag,
             [124.0, 110.0, 205.0, 106.0], 0, True))
        self.obj1817.out_connections_.append(self.obj1815)
        self.obj1815.in_connections_.append(self.obj1817)
        self.obj1817.graphObject_.pendingConnections.append(
            (self.obj1817.graphObject_.tag, self.obj1815.graphObject_.tag,
             [286.0, 102.0, 205.0, 106.0], 0, True))

        self.RHS = ASG_pns(parent)

        self.obj1819 = metarial(parent)
        self.obj1819.preAction(self.RHS.CREATE)
        self.obj1819.isGraphObjectVisual = True

        if (hasattr(self.obj1819, '_setHierarchicalLink')):
            self.obj1819._setHierarchicalLink(False)

        # MaxFlow
        self.obj1819.MaxFlow.setNone()

        # price
        self.obj1819.price.setValue(0)

        # Name
        self.obj1819.Name.setValue('')
        self.obj1819.Name.setNone()

        # ReqFlow
        self.obj1819.ReqFlow.setNone()

        self.obj1819.GGLabel.setValue(1)
        self.obj1819.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(180.0, 40.0, self.obj1819)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1819.graphObject_ = new_obj
        self.obj18190 = AttrCalc()
        self.obj18190.Copy = ATOM3Boolean()
        self.obj18190.Copy.setValue(('Copy from LHS', 1))
        self.obj18190.Copy.config = 0
        self.obj18190.Specify = ATOM3Constraint()
        self.obj18190.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1819.GGset2Any['MaxFlow'] = self.obj18190
        self.obj18191 = AttrCalc()
        self.obj18191.Copy = ATOM3Boolean()
        self.obj18191.Copy.setValue(('Copy from LHS', 1))
        self.obj18191.Copy.config = 0
        self.obj18191.Specify = ATOM3Constraint()
        self.obj18191.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1819.GGset2Any['Name'] = self.obj18191
        self.obj18192 = AttrCalc()
        self.obj18192.Copy = ATOM3Boolean()
        self.obj18192.Copy.setValue(('Copy from LHS', 1))
        self.obj18192.Copy.config = 0
        self.obj18192.Specify = ATOM3Constraint()
        self.obj18192.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1819.GGset2Any['ReqFlow'] = self.obj18192

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1819)
        self.obj1819.postAction(self.RHS.CREATE)

    def condition(self, graphID, isograph, atom3i):
        return self.graphRewritingSystem.finalStat > 20

    def action(self, graphID, isograph, atom3i):
        # If you want to apply this rule at most once on asingle host graph node,
        # then uncomment the next two lines. Change the default GG label (1) if needed.

        # Make sure to enable the CONDITION code as well
        # And to use the same label & unique name in the ACTION
        # WARNING: _uniqueName503 is not guaranteed to be unique (so change it, be safe!)

        #node = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        #node._uniqueName503 = True
        pass
示例#3
0
class CreateLinkMat_ARG2Goal_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 19)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)
        self.LHS.merge(ASG_omacs(parent))
        self.LHS.merge(ASG_GenericGraph(parent))

        self.obj1719 = metarial(parent)
        self.obj1719.preAction(self.LHS.CREATE)
        self.obj1719.isGraphObjectVisual = True

        if (hasattr(self.obj1719, '_setHierarchicalLink')):
            self.obj1719._setHierarchicalLink(False)

        # MaxFlow
        self.obj1719.MaxFlow.setNone()

        # price
        self.obj1719.price.setValue(0)

        # Name
        self.obj1719.Name.setValue('')
        self.obj1719.Name.setNone()

        # ReqFlow
        self.obj1719.ReqFlow.setNone()

        self.obj1719.GGLabel.setValue(4)
        self.obj1719.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(240.0, 20.0, self.obj1719)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1719.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1719)
        self.obj1719.postAction(self.LHS.CREATE)

        self.obj1720 = metarial(parent)
        self.obj1720.preAction(self.LHS.CREATE)
        self.obj1720.isGraphObjectVisual = True

        if (hasattr(self.obj1720, '_setHierarchicalLink')):
            self.obj1720._setHierarchicalLink(False)

        # MaxFlow
        self.obj1720.MaxFlow.setNone()

        # price
        self.obj1720.price.setValue(0)

        # Name
        self.obj1720.Name.setValue('')
        self.obj1720.Name.setNone()

        # ReqFlow
        self.obj1720.ReqFlow.setNone()

        self.obj1720.GGLabel.setValue(6)
        self.obj1720.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(240.0, 240.0, self.obj1720)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1720.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1720)
        self.obj1720.postAction(self.LHS.CREATE)

        self.obj1721 = operatingUnit(parent)
        self.obj1721.preAction(self.LHS.CREATE)
        self.obj1721.isGraphObjectVisual = True

        if (hasattr(self.obj1721, '_setHierarchicalLink')):
            self.obj1721._setHierarchicalLink(False)

        # OperCostProp
        self.obj1721.OperCostProp.setNone()

        # name
        self.obj1721.name.setValue('')
        self.obj1721.name.setNone()

        # OperCostFix
        self.obj1721.OperCostFix.setNone()

        self.obj1721.GGLabel.setValue(5)
        self.obj1721.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(240.0, 140.0, self.obj1721)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1721.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1721)
        self.obj1721.postAction(self.LHS.CREATE)

        self.obj1722 = fromMaterial(parent)
        self.obj1722.preAction(self.LHS.CREATE)
        self.obj1722.isGraphObjectVisual = True

        if (hasattr(self.obj1722, '_setHierarchicalLink')):
            self.obj1722._setHierarchicalLink(False)

        # rate
        self.obj1722.rate.setNone()

        self.obj1722.GGLabel.setValue(8)
        self.obj1722.graphClass_ = graph_fromMaterial
        if parent.genGraphics:
            new_obj = graph_fromMaterial(265.0, 100.0, self.obj1722)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1722.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1722)
        self.obj1722.postAction(self.LHS.CREATE)

        self.obj1723 = Goal(parent)
        self.obj1723.preAction(self.LHS.CREATE)
        self.obj1723.isGraphObjectVisual = True

        if (hasattr(self.obj1723, '_setHierarchicalLink')):
            self.obj1723._setHierarchicalLink(False)

        # name
        self.obj1723.name.setValue('')
        self.obj1723.name.setNone()

        self.obj1723.GGLabel.setValue(2)
        self.obj1723.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(60.0, 220.0, self.obj1723)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1723.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1723)
        self.obj1723.postAction(self.LHS.CREATE)

        self.obj1724 = Role(parent)
        self.obj1724.preAction(self.LHS.CREATE)
        self.obj1724.isGraphObjectVisual = True

        if (hasattr(self.obj1724, '_setHierarchicalLink')):
            self.obj1724._setHierarchicalLink(False)

        # name
        self.obj1724.name.setValue('')
        self.obj1724.name.setNone()

        self.obj1724.GGLabel.setValue(1)
        self.obj1724.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(60.0, 40.0, self.obj1724)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1724.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1724)
        self.obj1724.postAction(self.LHS.CREATE)

        self.obj1725 = achieve(parent)
        self.obj1725.preAction(self.LHS.CREATE)
        self.obj1725.isGraphObjectVisual = True

        if (hasattr(self.obj1725, '_setHierarchicalLink')):
            self.obj1725._setHierarchicalLink(False)

        # rate
        self.obj1725.rate.setNone()

        self.obj1725.GGLabel.setValue(3)
        self.obj1725.graphClass_ = graph_achieve
        if parent.genGraphics:
            new_obj = graph_achieve(97.5, 137.5, self.obj1725)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1725.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1725)
        self.obj1725.postAction(self.LHS.CREATE)

        self.obj1726 = GenericGraphEdge(parent)
        self.obj1726.preAction(self.LHS.CREATE)
        self.obj1726.isGraphObjectVisual = True

        if (hasattr(self.obj1726, '_setHierarchicalLink')):
            self.obj1726._setHierarchicalLink(False)

        self.obj1726.GGLabel.setValue(7)
        self.obj1726.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(215.0, 41.5, self.obj1726)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1726.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1726)
        self.obj1726.postAction(self.LHS.CREATE)

        self.obj1727 = GenericGraphEdge(parent)
        self.obj1727.preAction(self.LHS.CREATE)
        self.obj1727.isGraphObjectVisual = True

        if (hasattr(self.obj1727, '_setHierarchicalLink')):
            self.obj1727._setHierarchicalLink(False)

        self.obj1727.GGLabel.setValue(9)
        self.obj1727.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(185.0, 276.0, self.obj1727)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1727.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1727)
        self.obj1727.postAction(self.LHS.CREATE)

        self.obj1719.out_connections_.append(self.obj1722)
        self.obj1722.in_connections_.append(self.obj1719)
        self.obj1719.graphObject_.pendingConnections.append(
            (self.obj1719.graphObject_.tag, self.obj1722.graphObject_.tag,
             [264.0, 69.0, 265.0, 100.0], 0, True))
        self.obj1722.out_connections_.append(self.obj1721)
        self.obj1721.in_connections_.append(self.obj1722)
        self.obj1722.graphObject_.pendingConnections.append(
            (self.obj1722.graphObject_.tag, self.obj1721.graphObject_.tag,
             [260.0, 151.0, 352.0, 90.0], 0, True))
        self.obj1723.out_connections_.append(self.obj1727)
        self.obj1727.in_connections_.append(self.obj1723)
        self.obj1723.graphObject_.pendingConnections.append(
            (self.obj1723.graphObject_.tag, self.obj1727.graphObject_.tag,
             [84.0, 270.0, 185.0, 276.0], 0, True))
        self.obj1724.out_connections_.append(self.obj1725)
        self.obj1725.in_connections_.append(self.obj1724)
        self.obj1724.graphObject_.pendingConnections.append(
            (self.obj1724.graphObject_.tag, self.obj1725.graphObject_.tag,
             [84.0, 86.0, 97.5, 137.5], 0, True))
        self.obj1724.out_connections_.append(self.obj1726)
        self.obj1726.in_connections_.append(self.obj1724)
        self.obj1724.graphObject_.pendingConnections.append(
            (self.obj1724.graphObject_.tag, self.obj1726.graphObject_.tag,
             [84.0, 41.0, 215.0, 41.5], 0, True))
        self.obj1725.out_connections_.append(self.obj1723)
        self.obj1723.in_connections_.append(self.obj1725)
        self.obj1725.graphObject_.pendingConnections.append(
            (self.obj1725.graphObject_.tag, self.obj1723.graphObject_.tag,
             [83.0, 221.0, 93.5, 143.5], 0, True))
        self.obj1726.out_connections_.append(self.obj1719)
        self.obj1719.in_connections_.append(self.obj1726)
        self.obj1726.graphObject_.pendingConnections.append(
            (self.obj1726.graphObject_.tag, self.obj1719.graphObject_.tag,
             [246.0, 62.0, 215.0, 41.5], 0, True))
        self.obj1727.out_connections_.append(self.obj1720)
        self.obj1720.in_connections_.append(self.obj1727)
        self.obj1727.graphObject_.pendingConnections.append(
            (self.obj1727.graphObject_.tag, self.obj1720.graphObject_.tag,
             [246.0, 282.0, 185.0, 276.0], 0, True))

        self.RHS = ASG_pns(parent)
        self.RHS.merge(ASG_omacs(parent))
        self.RHS.merge(ASG_GenericGraph(parent))

        self.obj1731 = metarial(parent)
        self.obj1731.preAction(self.RHS.CREATE)
        self.obj1731.isGraphObjectVisual = True

        if (hasattr(self.obj1731, '_setHierarchicalLink')):
            self.obj1731._setHierarchicalLink(False)

        # MaxFlow
        self.obj1731.MaxFlow.setNone()

        # price
        self.obj1731.price.setValue(0)

        # Name
        self.obj1731.Name.setValue('')
        self.obj1731.Name.setNone()

        # ReqFlow
        self.obj1731.ReqFlow.setNone()

        self.obj1731.GGLabel.setValue(4)
        self.obj1731.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(280.0, 20.0, self.obj1731)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1731.graphObject_ = new_obj
        self.obj17310 = AttrCalc()
        self.obj17310.Copy = ATOM3Boolean()
        self.obj17310.Copy.setValue(('Copy from LHS', 1))
        self.obj17310.Copy.config = 0
        self.obj17310.Specify = ATOM3Constraint()
        self.obj17310.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1731.GGset2Any['MaxFlow'] = self.obj17310
        self.obj17311 = AttrCalc()
        self.obj17311.Copy = ATOM3Boolean()
        self.obj17311.Copy.setValue(('Copy from LHS', 1))
        self.obj17311.Copy.config = 0
        self.obj17311.Specify = ATOM3Constraint()
        self.obj17311.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1731.GGset2Any['Name'] = self.obj17311
        self.obj17312 = AttrCalc()
        self.obj17312.Copy = ATOM3Boolean()
        self.obj17312.Copy.setValue(('Copy from LHS', 1))
        self.obj17312.Copy.config = 0
        self.obj17312.Specify = ATOM3Constraint()
        self.obj17312.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1731.GGset2Any['ReqFlow'] = self.obj17312

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1731)
        self.obj1731.postAction(self.RHS.CREATE)

        self.obj1732 = metarial(parent)
        self.obj1732.preAction(self.RHS.CREATE)
        self.obj1732.isGraphObjectVisual = True

        if (hasattr(self.obj1732, '_setHierarchicalLink')):
            self.obj1732._setHierarchicalLink(False)

        # MaxFlow
        self.obj1732.MaxFlow.setNone()

        # price
        self.obj1732.price.setValue(0)

        # Name
        self.obj1732.Name.setValue('')
        self.obj1732.Name.setNone()

        # ReqFlow
        self.obj1732.ReqFlow.setNone()

        self.obj1732.GGLabel.setValue(6)
        self.obj1732.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(280.0, 240.0, self.obj1732)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1732.graphObject_ = new_obj
        self.obj17320 = AttrCalc()
        self.obj17320.Copy = ATOM3Boolean()
        self.obj17320.Copy.setValue(('Copy from LHS', 1))
        self.obj17320.Copy.config = 0
        self.obj17320.Specify = ATOM3Constraint()
        self.obj17320.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1732.GGset2Any['MaxFlow'] = self.obj17320
        self.obj17321 = AttrCalc()
        self.obj17321.Copy = ATOM3Boolean()
        self.obj17321.Copy.setValue(('Copy from LHS', 1))
        self.obj17321.Copy.config = 0
        self.obj17321.Specify = ATOM3Constraint()
        self.obj17321.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1732.GGset2Any['Name'] = self.obj17321
        self.obj17322 = AttrCalc()
        self.obj17322.Copy = ATOM3Boolean()
        self.obj17322.Copy.setValue(('Copy from LHS', 1))
        self.obj17322.Copy.config = 0
        self.obj17322.Specify = ATOM3Constraint()
        self.obj17322.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1732.GGset2Any['ReqFlow'] = self.obj17322

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1732)
        self.obj1732.postAction(self.RHS.CREATE)

        self.obj1733 = operatingUnit(parent)
        self.obj1733.preAction(self.RHS.CREATE)
        self.obj1733.isGraphObjectVisual = True

        if (hasattr(self.obj1733, '_setHierarchicalLink')):
            self.obj1733._setHierarchicalLink(False)

        # OperCostProp
        self.obj1733.OperCostProp.setNone()

        # name
        self.obj1733.name.setValue('')
        self.obj1733.name.setNone()

        # OperCostFix
        self.obj1733.OperCostFix.setNone()

        self.obj1733.GGLabel.setValue(5)
        self.obj1733.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(280.0, 140.0, self.obj1733)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1733.graphObject_ = new_obj
        self.obj17330 = AttrCalc()
        self.obj17330.Copy = ATOM3Boolean()
        self.obj17330.Copy.setValue(('Copy from LHS', 1))
        self.obj17330.Copy.config = 0
        self.obj17330.Specify = ATOM3Constraint()
        self.obj17330.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1733.GGset2Any['OperCostProp'] = self.obj17330
        self.obj17331 = AttrCalc()
        self.obj17331.Copy = ATOM3Boolean()
        self.obj17331.Copy.setValue(('Copy from LHS', 1))
        self.obj17331.Copy.config = 0
        self.obj17331.Specify = ATOM3Constraint()
        self.obj17331.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1733.GGset2Any['name'] = self.obj17331
        self.obj17332 = AttrCalc()
        self.obj17332.Copy = ATOM3Boolean()
        self.obj17332.Copy.setValue(('Copy from LHS', 1))
        self.obj17332.Copy.config = 0
        self.obj17332.Specify = ATOM3Constraint()
        self.obj17332.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1733.GGset2Any['OperCostFix'] = self.obj17332

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1733)
        self.obj1733.postAction(self.RHS.CREATE)

        self.obj1734 = intoMaterial(parent)
        self.obj1734.preAction(self.RHS.CREATE)
        self.obj1734.isGraphObjectVisual = True

        if (hasattr(self.obj1734, '_setHierarchicalLink')):
            self.obj1734._setHierarchicalLink(False)

        # rate
        self.obj1734.rate.setValue(0.0)

        self.obj1734.GGLabel.setValue(10)
        self.obj1734.graphClass_ = graph_intoMaterial
        if parent.genGraphics:
            new_obj = graph_intoMaterial(315.25, 202.5, self.obj1734)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1734.graphObject_ = new_obj
        self.obj17340 = AttrCalc()
        self.obj17340.Copy = ATOM3Boolean()
        self.obj17340.Copy.setValue(('Copy from LHS', 0))
        self.obj17340.Copy.config = 0
        self.obj17340.Specify = ATOM3Constraint()
        self.obj17340.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
             'return self.getMatched(graphID, self.LHS.nodeWithLabel(3)).rate.getValue()\n\n\n\n\n\n\n\n\n\n'
             ))
        self.obj1734.GGset2Any['rate'] = self.obj17340

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1734)
        self.obj1734.postAction(self.RHS.CREATE)

        self.obj1735 = fromMaterial(parent)
        self.obj1735.preAction(self.RHS.CREATE)
        self.obj1735.isGraphObjectVisual = True

        if (hasattr(self.obj1735, '_setHierarchicalLink')):
            self.obj1735._setHierarchicalLink(False)

        # rate
        self.obj1735.rate.setNone()

        self.obj1735.GGLabel.setValue(8)
        self.obj1735.graphClass_ = graph_fromMaterial
        if parent.genGraphics:
            new_obj = graph_fromMaterial(323.0, 83.0, self.obj1735)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1735.graphObject_ = new_obj
        self.obj17350 = AttrCalc()
        self.obj17350.Copy = ATOM3Boolean()
        self.obj17350.Copy.setValue(('Copy from LHS', 1))
        self.obj17350.Copy.config = 0
        self.obj17350.Specify = ATOM3Constraint()
        self.obj17350.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1735.GGset2Any['rate'] = self.obj17350

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1735)
        self.obj1735.postAction(self.RHS.CREATE)

        self.obj1736 = Goal(parent)
        self.obj1736.preAction(self.RHS.CREATE)
        self.obj1736.isGraphObjectVisual = True

        if (hasattr(self.obj1736, '_setHierarchicalLink')):
            self.obj1736._setHierarchicalLink(False)

        # name
        self.obj1736.name.setValue('')
        self.obj1736.name.setNone()

        self.obj1736.GGLabel.setValue(2)
        self.obj1736.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(60.0, 220.0, self.obj1736)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1736.graphObject_ = new_obj
        self.obj17360 = AttrCalc()
        self.obj17360.Copy = ATOM3Boolean()
        self.obj17360.Copy.setValue(('Copy from LHS', 1))
        self.obj17360.Copy.config = 0
        self.obj17360.Specify = ATOM3Constraint()
        self.obj17360.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1736.GGset2Any['name'] = self.obj17360

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1736)
        self.obj1736.postAction(self.RHS.CREATE)

        self.obj1737 = Role(parent)
        self.obj1737.preAction(self.RHS.CREATE)
        self.obj1737.isGraphObjectVisual = True

        if (hasattr(self.obj1737, '_setHierarchicalLink')):
            self.obj1737._setHierarchicalLink(False)

        # name
        self.obj1737.name.setValue('')
        self.obj1737.name.setNone()

        self.obj1737.GGLabel.setValue(1)
        self.obj1737.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(60.0, 40.0, self.obj1737)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1737.graphObject_ = new_obj
        self.obj17370 = AttrCalc()
        self.obj17370.Copy = ATOM3Boolean()
        self.obj17370.Copy.setValue(('Copy from LHS', 1))
        self.obj17370.Copy.config = 0
        self.obj17370.Specify = ATOM3Constraint()
        self.obj17370.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1737.GGset2Any['name'] = self.obj17370

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1737)
        self.obj1737.postAction(self.RHS.CREATE)

        self.obj1738 = achieve(parent)
        self.obj1738.preAction(self.RHS.CREATE)
        self.obj1738.isGraphObjectVisual = True

        if (hasattr(self.obj1738, '_setHierarchicalLink')):
            self.obj1738._setHierarchicalLink(False)

        # rate
        self.obj1738.rate.setNone()

        self.obj1738.GGLabel.setValue(3)
        self.obj1738.graphClass_ = graph_achieve
        if parent.genGraphics:
            new_obj = graph_achieve(93.5, 143.5, self.obj1738)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1738.graphObject_ = new_obj
        self.obj17380 = AttrCalc()
        self.obj17380.Copy = ATOM3Boolean()
        self.obj17380.Copy.setValue(('Copy from LHS', 1))
        self.obj17380.Copy.config = 0
        self.obj17380.Specify = ATOM3Constraint()
        self.obj17380.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1738.GGset2Any['rate'] = self.obj17380

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1738)
        self.obj1738.postAction(self.RHS.CREATE)

        self.obj1739 = GenericGraphEdge(parent)
        self.obj1739.preAction(self.RHS.CREATE)
        self.obj1739.isGraphObjectVisual = True

        if (hasattr(self.obj1739, '_setHierarchicalLink')):
            self.obj1739._setHierarchicalLink(False)

        self.obj1739.GGLabel.setValue(7)
        self.obj1739.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(215.0, 41.5, self.obj1739)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1739.graphObject_ = new_obj

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1739)
        self.obj1739.postAction(self.RHS.CREATE)

        self.obj1740 = GenericGraphEdge(parent)
        self.obj1740.preAction(self.RHS.CREATE)
        self.obj1740.isGraphObjectVisual = True

        if (hasattr(self.obj1740, '_setHierarchicalLink')):
            self.obj1740._setHierarchicalLink(False)

        self.obj1740.GGLabel.setValue(9)
        self.obj1740.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(185.0, 276.0, self.obj1740)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1740.graphObject_ = new_obj

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1740)
        self.obj1740.postAction(self.RHS.CREATE)

        self.obj1731.out_connections_.append(self.obj1735)
        self.obj1735.in_connections_.append(self.obj1731)
        self.obj1731.graphObject_.pendingConnections.append(
            (self.obj1731.graphObject_.tag, self.obj1735.graphObject_.tag,
             [284.0, 69.0, 323.0, 83.0], 2, 0))
        self.obj1733.out_connections_.append(self.obj1734)
        self.obj1734.in_connections_.append(self.obj1733)
        self.obj1733.graphObject_.pendingConnections.append(
            (self.obj1733.graphObject_.tag, self.obj1734.graphObject_.tag,
             [333.0, 148.0, 332.0, 167.0, 371.25, 179.5], 2, True))
        self.obj1734.out_connections_.append(self.obj1732)
        self.obj1732.in_connections_.append(self.obj1734)
        self.obj1734.graphObject_.pendingConnections.append(
            (self.obj1734.graphObject_.tag, self.obj1732.graphObject_.tag,
             [326.0, 250.0, 354.5, 215.0, 371.25, 179.5], 2, True))
        self.obj1735.out_connections_.append(self.obj1733)
        self.obj1733.in_connections_.append(self.obj1735)
        self.obj1735.graphObject_.pendingConnections.append(
            (self.obj1735.graphObject_.tag, self.obj1733.graphObject_.tag,
             [333.0, 148.0, 352.0, 90.0], 2, 0))
        self.obj1736.out_connections_.append(self.obj1740)
        self.obj1740.in_connections_.append(self.obj1736)
        self.obj1736.graphObject_.pendingConnections.append(
            (self.obj1736.graphObject_.tag, self.obj1740.graphObject_.tag,
             [94.0, 270.0, 185.0, 276.0], 2, 0))
        self.obj1737.out_connections_.append(self.obj1738)
        self.obj1738.in_connections_.append(self.obj1737)
        self.obj1737.graphObject_.pendingConnections.append(
            (self.obj1737.graphObject_.tag, self.obj1738.graphObject_.tag,
             [91.0, 85.0, 93.5, 143.5], 2, 0))
        self.obj1737.out_connections_.append(self.obj1739)
        self.obj1739.in_connections_.append(self.obj1737)
        self.obj1737.graphObject_.pendingConnections.append(
            (self.obj1737.graphObject_.tag, self.obj1739.graphObject_.tag,
             [91.0, 40.0, 215.0, 41.5], 2, 0))
        self.obj1738.out_connections_.append(self.obj1736)
        self.obj1736.in_connections_.append(self.obj1738)
        self.obj1738.graphObject_.pendingConnections.append(
            (self.obj1738.graphObject_.tag, self.obj1736.graphObject_.tag,
             [93.0, 221.0, 93.5, 143.5], 2, 0))
        self.obj1739.out_connections_.append(self.obj1731)
        self.obj1731.in_connections_.append(self.obj1739)
        self.obj1739.graphObject_.pendingConnections.append(
            (self.obj1739.graphObject_.tag, self.obj1731.graphObject_.tag,
             [266.0, 62.0, 215.0, 41.5], 2, 0))
        self.obj1740.out_connections_.append(self.obj1732)
        self.obj1732.in_connections_.append(self.obj1740)
        self.obj1740.graphObject_.pendingConnections.append(
            (self.obj1740.graphObject_.tag, self.obj1732.graphObject_.tag,
             [286.0, 282.0, 185.0, 276.0], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        print '======> Link Aux Condition'  # _ Agent2Raw_GG_rule.py _
        aRg = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
        nameARG = aRg.Name.getValue()
        g = self.getMatched(graphID, self.LHS.nodeWithLabel(6))
        # test if nameARG  end with name of Goal
        print nameARG + ' END WITH ' + g.Name.getValue()
        print nameARG.endswith(g.Name.getValue())
        if nameARG.endswith(g.Name.getValue()) and not hasattr(aRg, 'LinkAux'):
            print 'Real True'
            return True
        else:
            print 'Real False'
            return False

    def action(self, graphID, isograph, atom3i):
        print '======> Link Aux Action'
        aRg = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
        aRg.LinkAux = True
示例#4
0
class CollectInf3_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 6)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

        self.obj1596 = Role(parent)
        self.obj1596.preAction(self.LHS.CREATE)
        self.obj1596.isGraphObjectVisual = True

        if (hasattr(self.obj1596, '_setHierarchicalLink')):
            self.obj1596._setHierarchicalLink(False)

        # name
        self.obj1596.name.setValue('')
        self.obj1596.name.setNone()

        self.obj1596.GGLabel.setValue(2)
        self.obj1596.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(40.0, 40.0, self.obj1596)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1596.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1596)
        self.obj1596.postAction(self.LHS.CREATE)

        self.obj1597 = Goal(parent)
        self.obj1597.preAction(self.LHS.CREATE)
        self.obj1597.isGraphObjectVisual = True

        if (hasattr(self.obj1597, '_setHierarchicalLink')):
            self.obj1597._setHierarchicalLink(False)

        # name
        self.obj1597.name.setValue('')
        self.obj1597.name.setNone()

        self.obj1597.GGLabel.setValue(1)
        self.obj1597.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(300.0, 160.0, self.obj1597)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1597.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1597)
        self.obj1597.postAction(self.LHS.CREATE)

        self.obj1598 = achieve(parent)
        self.obj1598.preAction(self.LHS.CREATE)
        self.obj1598.isGraphObjectVisual = True

        if (hasattr(self.obj1598, '_setHierarchicalLink')):
            self.obj1598._setHierarchicalLink(False)

        # rate
        self.obj1598.rate.setNone()

        self.obj1598.GGLabel.setValue(3)
        self.obj1598.graphClass_ = graph_achieve
        if parent.genGraphics:
            new_obj = graph_achieve(171.25, 141.25, self.obj1598)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1598.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1598)
        self.obj1598.postAction(self.LHS.CREATE)

        self.obj1596.out_connections_.append(self.obj1598)
        self.obj1598.in_connections_.append(self.obj1596)
        self.obj1596.graphObject_.pendingConnections.append(
            (self.obj1596.graphObject_.tag, self.obj1598.graphObject_.tag,
             [64.0, 86.0, 106.5, 122.5, 171.25, 141.25], 2, True))
        self.obj1598.out_connections_.append(self.obj1597)
        self.obj1597.in_connections_.append(self.obj1598)
        self.obj1598.graphObject_.pendingConnections.append(
            (self.obj1598.graphObject_.tag, self.obj1597.graphObject_.tag,
             [323.0, 161.0, 236.0, 160.0, 171.25, 141.25], 2, True))

        self.RHS = ASG_omacs(parent)

        self.obj1600 = Role(parent)
        self.obj1600.preAction(self.RHS.CREATE)
        self.obj1600.isGraphObjectVisual = True

        if (hasattr(self.obj1600, '_setHierarchicalLink')):
            self.obj1600._setHierarchicalLink(False)

        # name
        self.obj1600.name.setValue('')
        self.obj1600.name.setNone()

        self.obj1600.GGLabel.setValue(2)
        self.obj1600.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(40.0, 40.0, self.obj1600)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1600.graphObject_ = new_obj
        self.obj16000 = AttrCalc()
        self.obj16000.Copy = ATOM3Boolean()
        self.obj16000.Copy.setValue(('Copy from LHS', 1))
        self.obj16000.Copy.config = 0
        self.obj16000.Specify = ATOM3Constraint()
        self.obj16000.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1600.GGset2Any['name'] = self.obj16000

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1600)
        self.obj1600.postAction(self.RHS.CREATE)

        self.obj1601 = Goal(parent)
        self.obj1601.preAction(self.RHS.CREATE)
        self.obj1601.isGraphObjectVisual = True

        if (hasattr(self.obj1601, '_setHierarchicalLink')):
            self.obj1601._setHierarchicalLink(False)

        # name
        self.obj1601.name.setValue('')
        self.obj1601.name.setNone()

        self.obj1601.GGLabel.setValue(1)
        self.obj1601.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(300.0, 160.0, self.obj1601)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1601.graphObject_ = new_obj
        self.obj16010 = AttrCalc()
        self.obj16010.Copy = ATOM3Boolean()
        self.obj16010.Copy.setValue(('Copy from LHS', 1))
        self.obj16010.Copy.config = 0
        self.obj16010.Specify = ATOM3Constraint()
        self.obj16010.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1601.GGset2Any['name'] = self.obj16010

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1601)
        self.obj1601.postAction(self.RHS.CREATE)

        self.obj1602 = achieve(parent)
        self.obj1602.preAction(self.RHS.CREATE)
        self.obj1602.isGraphObjectVisual = True

        if (hasattr(self.obj1602, '_setHierarchicalLink')):
            self.obj1602._setHierarchicalLink(False)

        # rate
        self.obj1602.rate.setNone()

        self.obj1602.GGLabel.setValue(3)
        self.obj1602.graphClass_ = graph_achieve
        if parent.genGraphics:
            new_obj = graph_achieve(171.25, 141.25, self.obj1602)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1602.graphObject_ = new_obj
        self.obj16020 = AttrCalc()
        self.obj16020.Copy = ATOM3Boolean()
        self.obj16020.Copy.setValue(('Copy from LHS', 1))
        self.obj16020.Copy.config = 0
        self.obj16020.Specify = ATOM3Constraint()
        self.obj16020.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1602.GGset2Any['rate'] = self.obj16020

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1602)
        self.obj1602.postAction(self.RHS.CREATE)

        self.obj1600.out_connections_.append(self.obj1602)
        self.obj1602.in_connections_.append(self.obj1600)
        self.obj1600.graphObject_.pendingConnections.append(
            (self.obj1600.graphObject_.tag, self.obj1602.graphObject_.tag,
             [71.0, 85.0, 171.25, 141.25], 2, 0))
        self.obj1602.out_connections_.append(self.obj1601)
        self.obj1601.in_connections_.append(self.obj1602)
        self.obj1602.graphObject_.pendingConnections.append(
            (self.obj1602.graphObject_.tag, self.obj1601.graphObject_.tag,
             [333.0, 161.0, 171.25, 141.25], 2, 0))

    def condition(self, graphID, isograph, atom3i):

        g = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        r = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        link = self.getMatched(graphID, self.LHS.nodeWithLabel(3))

        return not (hasattr(link,
                            "rule2" + g.name.getValue() + r.name.getValue()))

    def action(self, graphID, isograph, atom3i):
        g = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        r = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        link = self.getMatched(graphID, self.LHS.nodeWithLabel(3))

        setattr(link, "rule2" + g.name.getValue() + r.name.getValue(), True)

        print "Collect 3 " + g.name.getValue() + " " + r.name.getValue(
        ) + " " + str(link.rate.getValue())
        if not (r.name.getValue() in self.graphRewritingSystem.Dictro.keys()):
            self.graphRewritingSystem.Dictro[r.name.getValue()] = {}
        self.graphRewritingSystem.Dictro[r.name.getValue()][
            g.name.getValue()] = link.rate.getValue()

        print "Collect inf 3 DictRole " + str(self.graphRewritingSystem.Dictro)
class TransGoal2Mat_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 11)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)
        self.LHS.merge(ASG_omacs(parent))

        self.obj1638 = Goal(parent)
        self.obj1638.preAction(self.LHS.CREATE)
        self.obj1638.isGraphObjectVisual = True

        if (hasattr(self.obj1638, '_setHierarchicalLink')):
            self.obj1638._setHierarchicalLink(False)

        # name
        self.obj1638.name.setValue('')
        self.obj1638.name.setNone()

        self.obj1638.GGLabel.setValue(1)
        self.obj1638.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(80.0, 80.0, self.obj1638)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1638.graphObject_ = new_obj

        # Add node to the root: self.LHS
        self.LHS.addNode(self.obj1638)
        self.obj1638.postAction(self.LHS.CREATE)

        self.RHS = ASG_pns(parent)
        self.RHS.merge(ASG_omacs(parent))
        self.RHS.merge(ASG_GenericGraph(parent))

        self.obj1642 = metarial(parent)
        self.obj1642.preAction(self.RHS.CREATE)
        self.obj1642.isGraphObjectVisual = True

        if (hasattr(self.obj1642, '_setHierarchicalLink')):
            self.obj1642._setHierarchicalLink(False)

        # MaxFlow
        self.obj1642.MaxFlow.setValue(999999)

        # price
        self.obj1642.price.setValue(0)

        # Name
        self.obj1642.Name.setValue('')
        self.obj1642.Name.setNone()

        # ReqFlow
        self.obj1642.ReqFlow.setValue(0)

        self.obj1642.GGLabel.setValue(2)
        self.obj1642.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(300.0, 60.0, self.obj1642)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1642.graphObject_ = new_obj
        self.obj16420 = AttrCalc()
        self.obj16420.Copy = ATOM3Boolean()
        self.obj16420.Copy.setValue(('Copy from LHS', 1))
        self.obj16420.Copy.config = 0
        self.obj16420.Specify = ATOM3Constraint()
        self.obj16420.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1642.GGset2Any['MaxFlow'] = self.obj16420
        self.obj16421 = AttrCalc()
        self.obj16421.Copy = ATOM3Boolean()
        self.obj16421.Copy.setValue(('Copy from LHS', 0))
        self.obj16421.Copy.config = 0
        self.obj16421.Specify = ATOM3Constraint()
        self.obj16421.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
             'return self.getMatched(graphID, self.LHS.nodeWithLabel(1)).name.getValue()\n'
             ))
        self.obj1642.GGset2Any['Name'] = self.obj16421
        self.obj16422 = AttrCalc()
        self.obj16422.Copy = ATOM3Boolean()
        self.obj16422.Copy.setValue(('Copy from LHS', 1))
        self.obj16422.Copy.config = 0
        self.obj16422.Specify = ATOM3Constraint()
        self.obj16422.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1642.GGset2Any['ReqFlow'] = self.obj16422

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1642)
        self.obj1642.postAction(self.RHS.CREATE)

        self.obj1643 = Goal(parent)
        self.obj1643.preAction(self.RHS.CREATE)
        self.obj1643.isGraphObjectVisual = True

        if (hasattr(self.obj1643, '_setHierarchicalLink')):
            self.obj1643._setHierarchicalLink(False)

        # name
        self.obj1643.name.setValue('')
        self.obj1643.name.setNone()

        self.obj1643.GGLabel.setValue(1)
        self.obj1643.graphClass_ = graph_Goal
        if parent.genGraphics:
            new_obj = graph_Goal(80.0, 80.0, self.obj1643)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1643.graphObject_ = new_obj
        self.obj16430 = AttrCalc()
        self.obj16430.Copy = ATOM3Boolean()
        self.obj16430.Copy.setValue(('Copy from LHS', 1))
        self.obj16430.Copy.config = 0
        self.obj16430.Specify = ATOM3Constraint()
        self.obj16430.Specify.setValue(
            ('AttrSpecify', (['Python', 'OCL'], 0),
             (['PREcondition', 'POSTcondition'], 1), ([
                 'EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT',
                 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'
             ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
        self.obj1643.GGset2Any['name'] = self.obj16430

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1643)
        self.obj1643.postAction(self.RHS.CREATE)

        self.obj1644 = GenericGraphEdge(parent)
        self.obj1644.preAction(self.RHS.CREATE)
        self.obj1644.isGraphObjectVisual = True

        if (hasattr(self.obj1644, '_setHierarchicalLink')):
            self.obj1644._setHierarchicalLink(False)

        self.obj1644.GGLabel.setValue(4)
        self.obj1644.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(209.5, 91.5, self.obj1644)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1644.graphObject_ = new_obj

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1644)
        self.obj1644.postAction(self.RHS.CREATE)

        self.obj1643.out_connections_.append(self.obj1644)
        self.obj1644.in_connections_.append(self.obj1643)
        self.obj1643.graphObject_.pendingConnections.append(
            (self.obj1643.graphObject_.tag, self.obj1644.graphObject_.tag,
             [113.0, 81.0, 209.5, 91.5], 0, True))
        self.obj1644.out_connections_.append(self.obj1642)
        self.obj1642.in_connections_.append(self.obj1644)
        self.obj1644.graphObject_.pendingConnections.append(
            (self.obj1644.graphObject_.tag, self.obj1642.graphObject_.tag,
             [306.0, 102.0, 209.5, 91.5], 0, True))

    def condition(self, graphID, isograph, atom3i):
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        return not hasattr(node, "Goal2Mat")

    def action(self, graphID, isograph, atom3i):
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        node.Goal2Mat = True
示例#6
0
class CreateMat_ARG_GG_rule (GGrule):

   def __init__(self, parent):
      GGrule.__init__(self, 17)
      self.TimeDelay = ATOM3Integer(2)
      self.exactMatch = 1
      self.LHS = ASG_pns(parent)
      self.LHS.merge(ASG_omacs(parent))

      self.obj1696=CapableOf(parent)
      self.obj1696.preAction( self.LHS.CREATE )
      self.obj1696.isGraphObjectVisual = True

      if(hasattr(self.obj1696, '_setHierarchicalLink')):
        self.obj1696._setHierarchicalLink(False)

      # rate
      self.obj1696.rate.setNone()

      self.obj1696.GGLabel.setValue(4)
      self.obj1696.graphClass_= graph_CapableOf
      if parent.genGraphics:
         new_obj = graph_CapableOf(250.75,110.75,self.obj1696)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1696.graphObject_ = new_obj

      # Add node to the root: self.LHS
      self.LHS.addNode(self.obj1696)
      self.obj1696.postAction( self.LHS.CREATE )

      self.obj1697=Goal(parent)
      self.obj1697.preAction( self.LHS.CREATE )
      self.obj1697.isGraphObjectVisual = True

      if(hasattr(self.obj1697, '_setHierarchicalLink')):
        self.obj1697._setHierarchicalLink(False)

      # name
      self.obj1697.name.setValue('')
      self.obj1697.name.setNone()

      self.obj1697.GGLabel.setValue(3)
      self.obj1697.graphClass_= graph_Goal
      if parent.genGraphics:
         new_obj = graph_Goal(100.0,240.0,self.obj1697)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1697.graphObject_ = new_obj

      # Add node to the root: self.LHS
      self.LHS.addNode(self.obj1697)
      self.obj1697.postAction( self.LHS.CREATE )

      self.obj1698=Agent(parent)
      self.obj1698.preAction( self.LHS.CREATE )
      self.obj1698.isGraphObjectVisual = True

      if(hasattr(self.obj1698, '_setHierarchicalLink')):
        self.obj1698._setHierarchicalLink(False)

      # price
      self.obj1698.price.setNone()

      # name
      self.obj1698.name.setValue('')
      self.obj1698.name.setNone()

      self.obj1698.GGLabel.setValue(1)
      self.obj1698.graphClass_= graph_Agent
      if parent.genGraphics:
         new_obj = graph_Agent(80.0,40.0,self.obj1698)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1698.graphObject_ = new_obj

      # Add node to the root: self.LHS
      self.LHS.addNode(self.obj1698)
      self.obj1698.postAction( self.LHS.CREATE )

      self.obj1699=Role(parent)
      self.obj1699.preAction( self.LHS.CREATE )
      self.obj1699.isGraphObjectVisual = True

      if(hasattr(self.obj1699, '_setHierarchicalLink')):
        self.obj1699._setHierarchicalLink(False)

      # name
      self.obj1699.name.setValue('')
      self.obj1699.name.setNone()

      self.obj1699.GGLabel.setValue(2)
      self.obj1699.graphClass_= graph_Role
      if parent.genGraphics:
         new_obj = graph_Role(280.0,140.0,self.obj1699)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1699.graphObject_ = new_obj

      # Add node to the root: self.LHS
      self.LHS.addNode(self.obj1699)
      self.obj1699.postAction( self.LHS.CREATE )

      self.obj1700=achieve(parent)
      self.obj1700.preAction( self.LHS.CREATE )
      self.obj1700.isGraphObjectVisual = True

      if(hasattr(self.obj1700, '_setHierarchicalLink')):
        self.obj1700._setHierarchicalLink(False)

      # rate
      self.obj1700.rate.setNone()

      self.obj1700.GGLabel.setValue(5)
      self.obj1700.graphClass_= graph_achieve
      if parent.genGraphics:
         new_obj = graph_achieve(258.5,259.0,self.obj1700)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1700.graphObject_ = new_obj

      # Add node to the root: self.LHS
      self.LHS.addNode(self.obj1700)
      self.obj1700.postAction( self.LHS.CREATE )

      self.obj1696.out_connections_.append(self.obj1699)
      self.obj1699.in_connections_.append(self.obj1696)
      self.obj1696.graphObject_.pendingConnections.append((self.obj1696.graphObject_.tag, self.obj1699.graphObject_.tag, [304.0, 141.0, 300.5, 120.5, 250.75, 110.75], 2, True))
      self.obj1698.out_connections_.append(self.obj1696)
      self.obj1696.in_connections_.append(self.obj1698)
      self.obj1698.graphObject_.pendingConnections.append((self.obj1698.graphObject_.tag, self.obj1696.graphObject_.tag, [105.0, 102.0, 201.0, 101.0, 250.75, 110.75], 2, True))
      self.obj1699.out_connections_.append(self.obj1700)
      self.obj1700.in_connections_.append(self.obj1699)
      self.obj1699.graphObject_.pendingConnections.append((self.obj1699.graphObject_.tag, self.obj1700.graphObject_.tag, [304.0, 186.0, 303.5, 233.0, 258.5, 259.0], 2, True))
      self.obj1700.out_connections_.append(self.obj1697)
      self.obj1697.in_connections_.append(self.obj1700)
      self.obj1700.graphObject_.pendingConnections.append((self.obj1700.graphObject_.tag, self.obj1697.graphObject_.tag, [124.0, 290.0, 213.5, 285.0, 258.5, 259.0], 2, True))

      self.RHS = ASG_pns(parent)
      self.RHS.merge(ASG_omacs(parent))
      self.RHS.merge(ASG_GenericGraph(parent))

      self.obj1704=metarial(parent)
      self.obj1704.preAction( self.RHS.CREATE )
      self.obj1704.isGraphObjectVisual = True

      if(hasattr(self.obj1704, '_setHierarchicalLink')):
        self.obj1704._setHierarchicalLink(False)

      # MaxFlow
      self.obj1704.MaxFlow.setValue(999999)

      # price
      self.obj1704.price.setValue(0)

      # Name
      self.obj1704.Name.setValue('')
      self.obj1704.Name.setNone()

      # ReqFlow
      self.obj1704.ReqFlow.setValue(0)

      self.obj1704.GGLabel.setValue(8)
      self.obj1704.graphClass_= graph_metarial
      if parent.genGraphics:
         new_obj = graph_metarial(400.0,80.0,self.obj1704)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1704.graphObject_ = new_obj
      self.obj17040= AttrCalc()
      self.obj17040.Copy=ATOM3Boolean()
      self.obj17040.Copy.setValue(('Copy from LHS', 1))
      self.obj17040.Copy.config = 0
      self.obj17040.Specify=ATOM3Constraint()
      self.obj17040.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1704.GGset2Any['MaxFlow']= self.obj17040
      self.obj17041= AttrCalc()
      self.obj17041.Copy=ATOM3Boolean()
      self.obj17041.Copy.setValue(('Copy from LHS', 0))
      self.obj17041.Copy.config = 0
      self.obj17041.Specify=ATOM3Constraint()
      self.obj17041.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'return self.getMatched(graphID, self.LHS.nodeWithLabel(1)).name.getValue()+\' \'+ self.getMatched(graphID, self.LHS.nodeWithLabel(2)).name.getValue()+\' \'+ self.getMatched(graphID, self.LHS.nodeWithLabel(3)).name.getValue()\n\n'))
      self.obj1704.GGset2Any['Name']= self.obj17041
      self.obj17042= AttrCalc()
      self.obj17042.Copy=ATOM3Boolean()
      self.obj17042.Copy.setValue(('Copy from LHS', 1))
      self.obj17042.Copy.config = 0
      self.obj17042.Specify=ATOM3Constraint()
      self.obj17042.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1704.GGset2Any['ReqFlow']= self.obj17042

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1704)
      self.obj1704.postAction( self.RHS.CREATE )

      self.obj1705=operatingUnit(parent)
      self.obj1705.preAction( self.RHS.CREATE )
      self.obj1705.isGraphObjectVisual = True

      if(hasattr(self.obj1705, '_setHierarchicalLink')):
        self.obj1705._setHierarchicalLink(False)

      # OperCostProp
      self.obj1705.OperCostProp.setValue(0.0)

      # name
      self.obj1705.name.setValue('')
      self.obj1705.name.setNone()

      # OperCostFix
      self.obj1705.OperCostFix.setValue(0.0)

      self.obj1705.GGLabel.setValue(7)
      self.obj1705.graphClass_= graph_operatingUnit
      if parent.genGraphics:
         new_obj = graph_operatingUnit(400.0,240.0,self.obj1705)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1705.graphObject_ = new_obj
      self.obj17050= AttrCalc()
      self.obj17050.Copy=ATOM3Boolean()
      self.obj17050.Copy.setValue(('Copy from LHS', 0))
      self.obj17050.Copy.config = 0
      self.obj17050.Specify=ATOM3Constraint()
      self.obj17050.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'return self.getMatched(graphID, self.LHS.nodeWithLabel(5)).rate.getValue()\n'))
      self.obj1705.GGset2Any['OperCostProp']= self.obj17050
      self.obj17051= AttrCalc()
      self.obj17051.Copy=ATOM3Boolean()
      self.obj17051.Copy.setValue(('Copy from LHS', 0))
      self.obj17051.Copy.config = 0
      self.obj17051.Specify=ATOM3Constraint()
      self.obj17051.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'return self.getMatched(graphID, self.LHS.nodeWithLabel(1)).name.getValue()+\' \'+ self.getMatched(graphID, self.LHS.nodeWithLabel(2)).name.getValue()+\' \'+ self.getMatched(graphID, self.LHS.nodeWithLabel(3)).name.getValue()\n\n\n\n\n\n\n'))
      self.obj1705.GGset2Any['name']= self.obj17051
      self.obj17052= AttrCalc()
      self.obj17052.Copy=ATOM3Boolean()
      self.obj17052.Copy.setValue(('Copy from LHS', 0))
      self.obj17052.Copy.config = 0
      self.obj17052.Specify=ATOM3Constraint()
      self.obj17052.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 'return 2.0\n'))
      self.obj1705.GGset2Any['OperCostFix']= self.obj17052

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1705)
      self.obj1705.postAction( self.RHS.CREATE )

      self.obj1706=fromMaterial(parent)
      self.obj1706.preAction( self.RHS.CREATE )
      self.obj1706.isGraphObjectVisual = True

      if(hasattr(self.obj1706, '_setHierarchicalLink')):
        self.obj1706._setHierarchicalLink(False)

      # rate
      self.obj1706.rate.setValue(1.0)

      self.obj1706.GGLabel.setValue(9)
      self.obj1706.graphClass_= graph_fromMaterial
      if parent.genGraphics:
         new_obj = graph_fromMaterial(422.0,190.0,self.obj1706)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1706.graphObject_ = new_obj
      self.obj17060= AttrCalc()
      self.obj17060.Copy=ATOM3Boolean()
      self.obj17060.Copy.setValue(('Copy from LHS', 0))
      self.obj17060.Copy.config = 0
      self.obj17060.Specify=ATOM3Constraint()
      self.obj17060.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1706.GGset2Any['rate']= self.obj17060

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1706)
      self.obj1706.postAction( self.RHS.CREATE )

      self.obj1707=CapableOf(parent)
      self.obj1707.preAction( self.RHS.CREATE )
      self.obj1707.isGraphObjectVisual = True

      if(hasattr(self.obj1707, '_setHierarchicalLink')):
        self.obj1707._setHierarchicalLink(False)

      # rate
      self.obj1707.rate.setNone()

      self.obj1707.GGLabel.setValue(4)
      self.obj1707.graphClass_= graph_CapableOf
      if parent.genGraphics:
         new_obj = graph_CapableOf(250.75,110.75,self.obj1707)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1707.graphObject_ = new_obj
      self.obj17070= AttrCalc()
      self.obj17070.Copy=ATOM3Boolean()
      self.obj17070.Copy.setValue(('Copy from LHS', 1))
      self.obj17070.Copy.config = 0
      self.obj17070.Specify=ATOM3Constraint()
      self.obj17070.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1707.GGset2Any['rate']= self.obj17070

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1707)
      self.obj1707.postAction( self.RHS.CREATE )

      self.obj1708=Goal(parent)
      self.obj1708.preAction( self.RHS.CREATE )
      self.obj1708.isGraphObjectVisual = True

      if(hasattr(self.obj1708, '_setHierarchicalLink')):
        self.obj1708._setHierarchicalLink(False)

      # name
      self.obj1708.name.setValue('')
      self.obj1708.name.setNone()

      self.obj1708.GGLabel.setValue(3)
      self.obj1708.graphClass_= graph_Goal
      if parent.genGraphics:
         new_obj = graph_Goal(100.0,240.0,self.obj1708)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1708.graphObject_ = new_obj
      self.obj17080= AttrCalc()
      self.obj17080.Copy=ATOM3Boolean()
      self.obj17080.Copy.setValue(('Copy from LHS', 1))
      self.obj17080.Copy.config = 0
      self.obj17080.Specify=ATOM3Constraint()
      self.obj17080.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1708.GGset2Any['name']= self.obj17080

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1708)
      self.obj1708.postAction( self.RHS.CREATE )

      self.obj1709=Agent(parent)
      self.obj1709.preAction( self.RHS.CREATE )
      self.obj1709.isGraphObjectVisual = True

      if(hasattr(self.obj1709, '_setHierarchicalLink')):
        self.obj1709._setHierarchicalLink(False)

      # price
      self.obj1709.price.setNone()

      # name
      self.obj1709.name.setValue('')
      self.obj1709.name.setNone()

      self.obj1709.GGLabel.setValue(1)
      self.obj1709.graphClass_= graph_Agent
      if parent.genGraphics:
         new_obj = graph_Agent(80.0,40.0,self.obj1709)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1709.graphObject_ = new_obj
      self.obj17090= AttrCalc()
      self.obj17090.Copy=ATOM3Boolean()
      self.obj17090.Copy.setValue(('Copy from LHS', 1))
      self.obj17090.Copy.config = 0
      self.obj17090.Specify=ATOM3Constraint()
      self.obj17090.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1709.GGset2Any['price']= self.obj17090
      self.obj17091= AttrCalc()
      self.obj17091.Copy=ATOM3Boolean()
      self.obj17091.Copy.setValue(('Copy from LHS', 1))
      self.obj17091.Copy.config = 0
      self.obj17091.Specify=ATOM3Constraint()
      self.obj17091.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1709.GGset2Any['name']= self.obj17091

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1709)
      self.obj1709.postAction( self.RHS.CREATE )

      self.obj1710=Role(parent)
      self.obj1710.preAction( self.RHS.CREATE )
      self.obj1710.isGraphObjectVisual = True

      if(hasattr(self.obj1710, '_setHierarchicalLink')):
        self.obj1710._setHierarchicalLink(False)

      # name
      self.obj1710.name.setValue('')
      self.obj1710.name.setNone()

      self.obj1710.GGLabel.setValue(2)
      self.obj1710.graphClass_= graph_Role
      if parent.genGraphics:
         new_obj = graph_Role(280.0,140.0,self.obj1710)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1710.graphObject_ = new_obj
      self.obj17100= AttrCalc()
      self.obj17100.Copy=ATOM3Boolean()
      self.obj17100.Copy.setValue(('Copy from LHS', 1))
      self.obj17100.Copy.config = 0
      self.obj17100.Specify=ATOM3Constraint()
      self.obj17100.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1710.GGset2Any['name']= self.obj17100

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1710)
      self.obj1710.postAction( self.RHS.CREATE )

      self.obj1711=achieve(parent)
      self.obj1711.preAction( self.RHS.CREATE )
      self.obj1711.isGraphObjectVisual = True

      if(hasattr(self.obj1711, '_setHierarchicalLink')):
        self.obj1711._setHierarchicalLink(False)

      # rate
      self.obj1711.rate.setNone()

      self.obj1711.GGLabel.setValue(5)
      self.obj1711.graphClass_= graph_achieve
      if parent.genGraphics:
         new_obj = graph_achieve(258.5,259.0,self.obj1711)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1711.graphObject_ = new_obj
      self.obj17110= AttrCalc()
      self.obj17110.Copy=ATOM3Boolean()
      self.obj17110.Copy.setValue(('Copy from LHS', 1))
      self.obj17110.Copy.config = 0
      self.obj17110.Specify=ATOM3Constraint()
      self.obj17110.Specify.setValue(('AttrSpecify', (['Python', 'OCL'], 0), (['PREcondition', 'POSTcondition'], 1), (['EDIT', 'SAVE', 'CREATE', 'CONNECT', 'DELETE', 'DISCONNECT', 'TRANSFORM', 'SELECT', 'DRAG', 'DROP', 'MOVE'], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), None))
      self.obj1711.GGset2Any['rate']= self.obj17110

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1711)
      self.obj1711.postAction( self.RHS.CREATE )

      self.obj1712=GenericGraphEdge(parent)
      self.obj1712.preAction( self.RHS.CREATE )
      self.obj1712.isGraphObjectVisual = True

      if(hasattr(self.obj1712, '_setHierarchicalLink')):
        self.obj1712._setHierarchicalLink(False)

      self.obj1712.GGLabel.setValue(10)
      self.obj1712.graphClass_= graph_GenericGraphEdge
      if parent.genGraphics:
         new_obj = graph_GenericGraphEdge(358.5,131.0,self.obj1712)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1712.graphObject_ = new_obj

      # Add node to the root: self.RHS
      self.RHS.addNode(self.obj1712)
      self.obj1712.postAction( self.RHS.CREATE )

      self.obj1704.out_connections_.append(self.obj1706)
      self.obj1706.in_connections_.append(self.obj1704)
      self.obj1704.graphObject_.pendingConnections.append((self.obj1704.graphObject_.tag, self.obj1706.graphObject_.tag, [424.0, 129.0, 422.0, 190.0], 0, True))
      self.obj1706.out_connections_.append(self.obj1705)
      self.obj1705.in_connections_.append(self.obj1706)
      self.obj1706.graphObject_.pendingConnections.append((self.obj1706.graphObject_.tag, self.obj1705.graphObject_.tag, [420.0, 251.0, 422.0, 190.0], 0, True))
      self.obj1707.out_connections_.append(self.obj1710)
      self.obj1710.in_connections_.append(self.obj1707)
      self.obj1707.graphObject_.pendingConnections.append((self.obj1707.graphObject_.tag, self.obj1710.graphObject_.tag, [311.0, 140.0, 250.75, 110.75], 2, 0))
      self.obj1709.out_connections_.append(self.obj1707)
      self.obj1707.in_connections_.append(self.obj1709)
      self.obj1709.graphObject_.pendingConnections.append((self.obj1709.graphObject_.tag, self.obj1707.graphObject_.tag, [117.0, 102.0, 250.75, 110.75], 2, 0))
      self.obj1710.out_connections_.append(self.obj1711)
      self.obj1711.in_connections_.append(self.obj1710)
      self.obj1710.graphObject_.pendingConnections.append((self.obj1710.graphObject_.tag, self.obj1711.graphObject_.tag, [311.0, 185.0, 258.5, 259.0], 2, 0))
      self.obj1710.out_connections_.append(self.obj1712)
      self.obj1712.in_connections_.append(self.obj1710)
      self.obj1710.graphObject_.pendingConnections.append((self.obj1710.graphObject_.tag, self.obj1712.graphObject_.tag, [311.0, 140.0, 358.5, 131.0], 0, True))
      self.obj1711.out_connections_.append(self.obj1708)
      self.obj1708.in_connections_.append(self.obj1711)
      self.obj1711.graphObject_.pendingConnections.append((self.obj1711.graphObject_.tag, self.obj1708.graphObject_.tag, [134.0, 290.0, 258.5, 259.0], 2, 0))
      self.obj1712.out_connections_.append(self.obj1704)
      self.obj1704.in_connections_.append(self.obj1712)
      self.obj1712.graphObject_.pendingConnections.append((self.obj1712.graphObject_.tag, self.obj1704.graphObject_.tag, [406.0, 122.0, 358.5, 131.0], 0, True))

   def condition(self, graphID, isograph, atom3i):
      print '======> GenAux1 Condition'
      a = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
      aN = a.name.getValue()
      #print a.name.getValue()+' has att AUX : '+str( hasattr(a, "AUX") )
      r = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
      Rn = r.name.getValue()
      g = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
      Gn = g.name.getValue()
      # add list to the Agent Node
      if not hasattr(a,'markedNode') : 
      	a.markedNode = []
      	print 'add List to '+aN
      
      print 'CHeck if '+aN+'Have'
      for ele in a.markedNode : 
          if ele == (Rn,Gn) : return False
      return True
      #        print 'Check if '+aN+'Have '
      #        for ele in a.markedNode : 
      #            if ele == (Rn,Gn) : return False 
      #        return True
      
      

   def action(self, graphID, isograph, atom3i):
      print '======> GenAux1 ACtion'
      a = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
      aN = a.name.getValue()
      #print a.name.getValue()+' has att AUX : '+str( hasattr(a, "AUX") )
      r = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
      Rn = r.name.getValue()
      g = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
      Gn = g.name.getValue()
      # add ele list to the Agent Node
      print 'Add Ele into list of '+aN
      a.markedNode.append( (Rn,Gn) )
      print 'List of MarkedNode'
      for ele in a.markedNode : 
      	print ele