Exemplo n.º 1
0
class TransLinkAR2OpUnit_GG_rule (GGrule):

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

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

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

      # price
      self.obj1622.price.setNone()

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

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

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

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

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

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

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

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

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

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

      # rate
      self.obj1624.rate.setNone()

      self.obj1624.GGLabel.setValue(3)
      self.obj1624.graphClass_= graph_CapableOf
      if parent.genGraphics:
         new_obj = graph_CapableOf(230.0,173.0,self.obj1624)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1624.graphObject_ = new_obj

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

      self.obj1622.out_connections_.append(self.obj1624)
      self.obj1624.in_connections_.append(self.obj1622)
      self.obj1622.graphObject_.pendingConnections.append((self.obj1622.graphObject_.tag, self.obj1624.graphObject_.tag, [85.0, 102.0, 117.0, 188.0, 230.0, 173.0], 2, True))
      self.obj1624.out_connections_.append(self.obj1623)
      self.obj1623.in_connections_.append(self.obj1624)
      self.obj1624.graphObject_.pendingConnections.append((self.obj1624.graphObject_.tag, self.obj1623.graphObject_.tag, [344.0, 221.0, 343.0, 158.0, 230.0, 173.0], 2, True))

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

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

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

      # price
      self.obj1628.price.setNone()

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

      self.obj1628.GGLabel.setValue(1)
      self.obj1628.graphClass_= graph_Agent
      if parent.genGraphics:
         new_obj = graph_Agent(60.0,40.0,self.obj1628)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1628.graphObject_ = new_obj
      self.obj16280= AttrCalc()
      self.obj16280.Copy=ATOM3Boolean()
      self.obj16280.Copy.setValue(('Copy from LHS', 1))
      self.obj16280.Copy.config = 0
      self.obj16280.Specify=ATOM3Constraint()
      self.obj16280.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.obj1628.GGset2Any['price']= self.obj16280
      self.obj16281= AttrCalc()
      self.obj16281.Copy=ATOM3Boolean()
      self.obj16281.Copy.setValue(('Copy from LHS', 1))
      self.obj16281.Copy.config = 0
      self.obj16281.Specify=ATOM3Constraint()
      self.obj16281.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.obj1628.GGset2Any['name']= self.obj16281

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

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

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

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

      self.obj1629.GGLabel.setValue(2)
      self.obj1629.graphClass_= graph_Role
      if parent.genGraphics:
         new_obj = graph_Role(320.0,220.0,self.obj1629)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1629.graphObject_ = new_obj
      self.obj16290= AttrCalc()
      self.obj16290.Copy=ATOM3Boolean()
      self.obj16290.Copy.setValue(('Copy from LHS', 1))
      self.obj16290.Copy.config = 0
      self.obj16290.Specify=ATOM3Constraint()
      self.obj16290.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.obj1629.GGset2Any['name']= self.obj16290

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

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

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

      # rate
      self.obj1630.rate.setNone()

      self.obj1630.GGLabel.setValue(3)
      self.obj1630.graphClass_= graph_CapableOf
      if parent.genGraphics:
         new_obj = graph_CapableOf(230.0,173.0,self.obj1630)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1630.graphObject_ = new_obj
      self.obj16300= AttrCalc()
      self.obj16300.Copy=ATOM3Boolean()
      self.obj16300.Copy.setValue(('Copy from LHS', 1))
      self.obj16300.Copy.config = 0
      self.obj16300.Specify=ATOM3Constraint()
      self.obj16300.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.obj1630.GGset2Any['rate']= self.obj16300

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

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

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

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

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

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

      self.obj1631.GGLabel.setValue(5)
      self.obj1631.graphClass_= graph_operatingUnit
      if parent.genGraphics:
         new_obj = graph_operatingUnit(60.0,220.0,self.obj1631)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1631.graphObject_ = new_obj
      self.obj16310= AttrCalc()
      self.obj16310.Copy=ATOM3Boolean()
      self.obj16310.Copy.setValue(('Copy from LHS', 1))
      self.obj16310.Copy.config = 0
      self.obj16310.Specify=ATOM3Constraint()
      self.obj16310.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.obj1631.GGset2Any['OperCostProp']= self.obj16310
      self.obj16311= AttrCalc()
      self.obj16311.Copy=ATOM3Boolean()
      self.obj16311.Copy.setValue(('Copy from LHS', 0))
      self.obj16311.Copy.config = 0
      self.obj16311.Specify=ATOM3Constraint()
      self.obj16311.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()\n\n\n\n'))
      self.obj1631.GGset2Any['name']= self.obj16311
      self.obj16312= AttrCalc()
      self.obj16312.Copy=ATOM3Boolean()
      self.obj16312.Copy.setValue(('Copy from LHS', 1))
      self.obj16312.Copy.config = 0
      self.obj16312.Specify=ATOM3Constraint()
      self.obj16312.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.obj1631.GGset2Any['OperCostFix']= self.obj16312

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

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

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

      self.obj1632.GGLabel.setValue(6)
      self.obj1632.graphClass_= graph_GenericGraphEdge
      if parent.genGraphics:
         new_obj = graph_GenericGraphEdge(103.5,161.5,self.obj1632)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1632.graphObject_ = new_obj

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

      self.obj1628.out_connections_.append(self.obj1630)
      self.obj1630.in_connections_.append(self.obj1628)
      self.obj1628.graphObject_.pendingConnections.append((self.obj1628.graphObject_.tag, self.obj1630.graphObject_.tag, [97.0, 102.0, 230.0, 173.0], 2, 0))
      self.obj1628.out_connections_.append(self.obj1632)
      self.obj1632.in_connections_.append(self.obj1628)
      self.obj1628.graphObject_.pendingConnections.append((self.obj1628.graphObject_.tag, self.obj1632.graphObject_.tag, [97.0, 102.0, 103.5, 161.5], 0, True))
      self.obj1630.out_connections_.append(self.obj1629)
      self.obj1629.in_connections_.append(self.obj1630)
      self.obj1630.graphObject_.pendingConnections.append((self.obj1630.graphObject_.tag, self.obj1629.graphObject_.tag, [351.0, 220.0, 230.0, 173.0], 2, 0))
      self.obj1632.out_connections_.append(self.obj1631)
      self.obj1631.in_connections_.append(self.obj1632)
      self.obj1632.graphObject_.pendingConnections.append((self.obj1632.graphObject_.tag, self.obj1631.graphObject_.tag, [110.0, 221.0, 103.5, 161.5], 0, True))

   def condition(self, graphID, isograph, atom3i):
      node = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
      node2 = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
      print node.name.getValue()+' '+node2.name.getValue()
      # remplaceed by  "LinkAR2OpUnit"
      return not(  hasattr(node,node2.name.getValue()+'7') and hasattr(node2, node.name.getValue()+'7') )
      
      

   def action(self, graphID, isograph, atom3i):
      node = self.getMatched ( graphID , self.LHS.nodeWithLabel(1) )
      
      node2 = self.getMatched ( graphID , self.LHS.nodeWithLabel(2) )
      setattr( node ,node2.name.getValue()+'7' ,True )
      setattr( node2 ,node.name.getValue()+'7' ,True )
class Agent2RoleLink3_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 3)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

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

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

        # price
        self.obj1548.price.setNone()

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

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

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

        self.obj1549 = Capabilitie(parent)
        self.obj1549.preAction(self.LHS.CREATE)
        self.obj1549.isGraphObjectVisual = True

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

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

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

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

        self.obj1550 = Capabilitie(parent)
        self.obj1550.preAction(self.LHS.CREATE)
        self.obj1550.isGraphObjectVisual = True

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

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

        self.obj1550.GGLabel.setValue(4)
        self.obj1550.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(140.0, 160.0, self.obj1550)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1550.graphObject_ = new_obj

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

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

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

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

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

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

        self.obj1552 = posses(parent)
        self.obj1552.preAction(self.LHS.CREATE)
        self.obj1552.isGraphObjectVisual = True

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

        # rate
        self.obj1552.rate.setNone()

        self.obj1552.GGLabel.setValue(5)
        self.obj1552.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(143.0, 120.5, self.obj1552)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1552.graphObject_ = new_obj

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

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

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

        # rate
        self.obj1553.rate.setNone()

        self.obj1553.GGLabel.setValue(8)
        self.obj1553.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(224.5, 111.5, self.obj1553)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1553.graphObject_ = new_obj

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

        self.obj1554 = require(parent)
        self.obj1554.preAction(self.LHS.CREATE)
        self.obj1554.isGraphObjectVisual = True

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

        self.obj1554.GGLabel.setValue(7)
        self.obj1554.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(242.5, 192.5, self.obj1554)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1554.graphObject_ = new_obj

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

        self.obj1555 = require(parent)
        self.obj1555.preAction(self.LHS.CREATE)
        self.obj1555.isGraphObjectVisual = True

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

        self.obj1555.GGLabel.setValue(9)
        self.obj1555.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(351.0, 111.5, self.obj1555)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1555.graphObject_ = new_obj

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

        self.obj1548.out_connections_.append(self.obj1552)
        self.obj1552.in_connections_.append(self.obj1548)
        self.obj1548.graphObject_.pendingConnections.append(
            (self.obj1548.graphObject_.tag, self.obj1552.graphObject_.tag,
             [137.0, 82.0, 143.0, 120.5], 2, 0))
        self.obj1548.out_connections_.append(self.obj1553)
        self.obj1553.in_connections_.append(self.obj1548)
        self.obj1548.graphObject_.pendingConnections.append(
            (self.obj1548.graphObject_.tag, self.obj1553.graphObject_.tag,
             [125.0, 82.0, 224.5, 111.5], 0, True))
        self.obj1551.out_connections_.append(self.obj1554)
        self.obj1554.in_connections_.append(self.obj1551)
        self.obj1551.graphObject_.pendingConnections.append(
            (self.obj1551.graphObject_.tag, self.obj1554.graphObject_.tag,
             [324.0, 186.0, 242.5, 192.5], 0, True))
        self.obj1551.out_connections_.append(self.obj1555)
        self.obj1555.in_connections_.append(self.obj1551)
        self.obj1551.graphObject_.pendingConnections.append(
            (self.obj1551.graphObject_.tag, self.obj1555.graphObject_.tag,
             [331.0, 140.0, 351.0, 111.5], 0, True))
        self.obj1552.out_connections_.append(self.obj1550)
        self.obj1550.in_connections_.append(self.obj1552)
        self.obj1552.graphObject_.pendingConnections.append(
            (self.obj1552.graphObject_.tag, self.obj1550.graphObject_.tag,
             [161.0, 159.0, 143.0, 120.5], 0, True))
        self.obj1553.out_connections_.append(self.obj1551)
        self.obj1551.in_connections_.append(self.obj1553)
        self.obj1553.graphObject_.pendingConnections.append(
            (self.obj1553.graphObject_.tag, self.obj1551.graphObject_.tag,
             [324.0, 141.0, 224.5, 111.5], 0, True))
        self.obj1554.out_connections_.append(self.obj1550)
        self.obj1550.in_connections_.append(self.obj1554)
        self.obj1554.graphObject_.pendingConnections.append(
            (self.obj1554.graphObject_.tag, self.obj1550.graphObject_.tag,
             [161.0, 199.0, 242.5, 192.5], 0, True))
        self.obj1555.out_connections_.append(self.obj1549)
        self.obj1549.in_connections_.append(self.obj1555)
        self.obj1555.graphObject_.pendingConnections.append(
            (self.obj1555.graphObject_.tag, self.obj1549.graphObject_.tag,
             [371.0, 83.0, 351.0, 111.5], 0, True))

        self.RHS = ASG_omacs(parent)

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

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

        # price
        self.obj1557.price.setNone()

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

        self.obj1557.GGLabel.setValue(1)
        self.obj1557.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(100.0, 20.0, self.obj1557)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1557.graphObject_ = new_obj
        self.obj15570 = AttrCalc()
        self.obj15570.Copy = ATOM3Boolean()
        self.obj15570.Copy.setValue(('Copy from LHS', 1))
        self.obj15570.Copy.config = 0
        self.obj15570.Specify = ATOM3Constraint()
        self.obj15570.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.obj1557.GGset2Any['price'] = self.obj15570
        self.obj15571 = AttrCalc()
        self.obj15571.Copy = ATOM3Boolean()
        self.obj15571.Copy.setValue(('Copy from LHS', 1))
        self.obj15571.Copy.config = 0
        self.obj15571.Specify = ATOM3Constraint()
        self.obj15571.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.obj1557.GGset2Any['name'] = self.obj15571

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

        self.obj1558 = Capabilitie(parent)
        self.obj1558.preAction(self.RHS.CREATE)
        self.obj1558.isGraphObjectVisual = True

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

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

        self.obj1558.GGLabel.setValue(3)
        self.obj1558.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(340.0, 40.0, self.obj1558)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1558.graphObject_ = new_obj
        self.obj15580 = AttrCalc()
        self.obj15580.Copy = ATOM3Boolean()
        self.obj15580.Copy.setValue(('Copy from LHS', 1))
        self.obj15580.Copy.config = 0
        self.obj15580.Specify = ATOM3Constraint()
        self.obj15580.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.obj1558.GGset2Any['name'] = self.obj15580

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

        self.obj1559 = Capabilitie(parent)
        self.obj1559.preAction(self.RHS.CREATE)
        self.obj1559.isGraphObjectVisual = True

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

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

        self.obj1559.GGLabel.setValue(4)
        self.obj1559.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(140.0, 160.0, self.obj1559)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1559.graphObject_ = new_obj
        self.obj15590 = AttrCalc()
        self.obj15590.Copy = ATOM3Boolean()
        self.obj15590.Copy.setValue(('Copy from LHS', 1))
        self.obj15590.Copy.config = 0
        self.obj15590.Specify = ATOM3Constraint()
        self.obj15590.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.obj1559.GGset2Any['name'] = self.obj15590

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

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

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

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

        self.obj1560.GGLabel.setValue(2)
        self.obj1560.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(300.0, 140.0, self.obj1560)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1560.graphObject_ = new_obj
        self.obj15600 = AttrCalc()
        self.obj15600.Copy = ATOM3Boolean()
        self.obj15600.Copy.setValue(('Copy from LHS', 1))
        self.obj15600.Copy.config = 0
        self.obj15600.Specify = ATOM3Constraint()
        self.obj15600.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.obj1560.GGset2Any['name'] = self.obj15600

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

        self.obj1561 = posses(parent)
        self.obj1561.preAction(self.RHS.CREATE)
        self.obj1561.isGraphObjectVisual = True

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

        # rate
        self.obj1561.rate.setNone()

        self.obj1561.GGLabel.setValue(5)
        self.obj1561.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(143.0, 120.5, self.obj1561)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1561.graphObject_ = new_obj
        self.obj15610 = AttrCalc()
        self.obj15610.Copy = ATOM3Boolean()
        self.obj15610.Copy.setValue(('Copy from LHS', 1))
        self.obj15610.Copy.config = 0
        self.obj15610.Specify = ATOM3Constraint()
        self.obj15610.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.obj1561.GGset2Any['rate'] = self.obj15610

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

        self.obj1562 = require(parent)
        self.obj1562.preAction(self.RHS.CREATE)
        self.obj1562.isGraphObjectVisual = True

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

        self.obj1562.GGLabel.setValue(7)
        self.obj1562.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(242.5, 192.5, self.obj1562)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1562.graphObject_ = new_obj

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

        self.obj1563 = require(parent)
        self.obj1563.preAction(self.RHS.CREATE)
        self.obj1563.isGraphObjectVisual = True

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

        self.obj1563.GGLabel.setValue(9)
        self.obj1563.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(351.0, 111.5, self.obj1563)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1563.graphObject_ = new_obj

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

        self.obj1557.out_connections_.append(self.obj1561)
        self.obj1561.in_connections_.append(self.obj1557)
        self.obj1557.graphObject_.pendingConnections.append(
            (self.obj1557.graphObject_.tag, self.obj1561.graphObject_.tag,
             [137.0, 82.0, 143.0, 120.5], 2, 0))
        self.obj1560.out_connections_.append(self.obj1562)
        self.obj1562.in_connections_.append(self.obj1560)
        self.obj1560.graphObject_.pendingConnections.append(
            (self.obj1560.graphObject_.tag, self.obj1562.graphObject_.tag,
             [331.0, 185.0, 242.5, 192.5], 2, 0))
        self.obj1560.out_connections_.append(self.obj1563)
        self.obj1563.in_connections_.append(self.obj1560)
        self.obj1560.graphObject_.pendingConnections.append(
            (self.obj1560.graphObject_.tag, self.obj1563.graphObject_.tag,
             [331.0, 140.0, 351.0, 111.5], 0, True))
        self.obj1561.out_connections_.append(self.obj1559)
        self.obj1559.in_connections_.append(self.obj1561)
        self.obj1561.graphObject_.pendingConnections.append(
            (self.obj1561.graphObject_.tag, self.obj1559.graphObject_.tag,
             [171.0, 163.0, 143.0, 120.5], 2, 0))
        self.obj1562.out_connections_.append(self.obj1559)
        self.obj1559.in_connections_.append(self.obj1562)
        self.obj1562.graphObject_.pendingConnections.append(
            (self.obj1562.graphObject_.tag, self.obj1559.graphObject_.tag,
             [171.0, 203.0, 242.5, 192.5], 2, 0))
        self.obj1563.out_connections_.append(self.obj1558)
        self.obj1558.in_connections_.append(self.obj1563)
        self.obj1563.graphObject_.pendingConnections.append(
            (self.obj1563.graphObject_.tag, self.obj1558.graphObject_.tag,
             [371.0, 83.0, 351.0, 111.5], 0, True))

    def condition(self, graphID, isograph, atom3i):
        agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        role = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        c2 = self.getMatched(graphID, self.LHS.nodeWithLabel(4))

        return not (hasattr(c1, agent.name.getValue()) and hasattr(
            c1, role.name.getValue()) and hasattr(c2, agent.name.getValue())
                    and hasattr(c2, role.name.getValue()))

    def action(self, graphID, isograph, atom3i):
        agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
        c2 = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        role = self.getMatched(graphID, self.LHS.nodeWithLabel(2))

        setattr(c1, agent.name.getValue(), True)
        setattr(c1, role.name.getValue(), True)

        setattr(c2, agent.name.getValue(), True)
        setattr(c2, role.name.getValue(), True)
        print ' Eli : (' + agent.name.getValue() + ',' + c1.name.getValue(
        ) + ',' + c2.name.getValue() + ',' + role.name.getValue() + ')'
class Agent2RoleLink1_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 1)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

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

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

        # price
        self.obj1509.price.setNone()

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

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

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

        self.obj1510 = Capabilitie(parent)
        self.obj1510.preAction(self.LHS.CREATE)
        self.obj1510.isGraphObjectVisual = True

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

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

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

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

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

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

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

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

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

        self.obj1512 = posses(parent)
        self.obj1512.preAction(self.LHS.CREATE)
        self.obj1512.isGraphObjectVisual = True

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

        # rate
        self.obj1512.rate.setNone()

        self.obj1512.GGLabel.setValue(4)
        self.obj1512.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(143.0, 130.5, self.obj1512)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1512.graphObject_ = new_obj

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

        self.obj1513 = require(parent)
        self.obj1513.preAction(self.LHS.CREATE)
        self.obj1513.isGraphObjectVisual = True

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

        self.obj1513.GGLabel.setValue(5)
        self.obj1513.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(242.5, 132.5, self.obj1513)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1513.graphObject_ = new_obj

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

        self.obj1509.out_connections_.append(self.obj1512)
        self.obj1512.in_connections_.append(self.obj1509)
        self.obj1509.graphObject_.pendingConnections.append(
            (self.obj1509.graphObject_.tag, self.obj1512.graphObject_.tag,
             [105.0, 82.0, 143.0, 130.5], 0, True))
        self.obj1511.out_connections_.append(self.obj1513)
        self.obj1513.in_connections_.append(self.obj1511)
        self.obj1511.graphObject_.pendingConnections.append(
            (self.obj1511.graphObject_.tag, self.obj1513.graphObject_.tag,
             [304.0, 86.0, 242.5, 132.5], 0, True))
        self.obj1512.out_connections_.append(self.obj1510)
        self.obj1510.in_connections_.append(self.obj1512)
        self.obj1512.graphObject_.pendingConnections.append(
            (self.obj1512.graphObject_.tag, self.obj1510.graphObject_.tag,
             [181.0, 179.0, 143.0, 130.5], 0, True))
        self.obj1513.out_connections_.append(self.obj1510)
        self.obj1510.in_connections_.append(self.obj1513)
        self.obj1513.graphObject_.pendingConnections.append(
            (self.obj1513.graphObject_.tag, self.obj1510.graphObject_.tag,
             [181.0, 179.0, 242.5, 132.5], 0, True))

        self.RHS = ASG_omacs(parent)

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

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

        # price
        self.obj1515.price.setNone()

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

        self.obj1515.GGLabel.setValue(1)
        self.obj1515.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(80.0, 20.0, self.obj1515)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1515.graphObject_ = new_obj
        self.obj15150 = AttrCalc()
        self.obj15150.Copy = ATOM3Boolean()
        self.obj15150.Copy.setValue(('Copy from LHS', 1))
        self.obj15150.Copy.config = 0
        self.obj15150.Specify = ATOM3Constraint()
        self.obj15150.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.obj1515.GGset2Any['price'] = self.obj15150
        self.obj15151 = AttrCalc()
        self.obj15151.Copy = ATOM3Boolean()
        self.obj15151.Copy.setValue(('Copy from LHS', 1))
        self.obj15151.Copy.config = 0
        self.obj15151.Specify = ATOM3Constraint()
        self.obj15151.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.obj1515.GGset2Any['name'] = self.obj15151

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

        self.obj1516 = Capabilitie(parent)
        self.obj1516.preAction(self.RHS.CREATE)
        self.obj1516.isGraphObjectVisual = True

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

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

        self.obj1516.GGLabel.setValue(2)
        self.obj1516.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(160.0, 180.0, self.obj1516)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1516.graphObject_ = new_obj
        self.obj15160 = AttrCalc()
        self.obj15160.Copy = ATOM3Boolean()
        self.obj15160.Copy.setValue(('Copy from LHS', 1))
        self.obj15160.Copy.config = 0
        self.obj15160.Specify = ATOM3Constraint()
        self.obj15160.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.obj1516.GGset2Any['name'] = self.obj15160

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

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

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

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

        self.obj1517.GGLabel.setValue(3)
        self.obj1517.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(280.0, 40.0, self.obj1517)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1517.graphObject_ = new_obj
        self.obj15170 = AttrCalc()
        self.obj15170.Copy = ATOM3Boolean()
        self.obj15170.Copy.setValue(('Copy from LHS', 1))
        self.obj15170.Copy.config = 0
        self.obj15170.Specify = ATOM3Constraint()
        self.obj15170.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.obj1517.GGset2Any['name'] = self.obj15170

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

        self.obj1518 = posses(parent)
        self.obj1518.preAction(self.RHS.CREATE)
        self.obj1518.isGraphObjectVisual = True

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

        # rate
        self.obj1518.rate.setNone()

        self.obj1518.GGLabel.setValue(4)
        self.obj1518.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(143.0, 130.5, self.obj1518)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1518.graphObject_ = new_obj
        self.obj15180 = AttrCalc()
        self.obj15180.Copy = ATOM3Boolean()
        self.obj15180.Copy.setValue(('Copy from LHS', 1))
        self.obj15180.Copy.config = 0
        self.obj15180.Specify = ATOM3Constraint()
        self.obj15180.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.obj1518.GGset2Any['rate'] = self.obj15180

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

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

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

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

        self.obj1519.GGLabel.setValue(7)
        self.obj1519.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(214.0, 83.5, self.obj1519)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1519.graphObject_ = new_obj
        self.obj15190 = AttrCalc()
        self.obj15190.Copy = ATOM3Boolean()
        self.obj15190.Copy.setValue(('Copy from LHS', 1))
        self.obj15190.Copy.config = 0
        self.obj15190.Specify = ATOM3Constraint()
        self.obj15190.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.obj1519.GGset2Any['rate'] = self.obj15190

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

        self.obj1520 = require(parent)
        self.obj1520.preAction(self.RHS.CREATE)
        self.obj1520.isGraphObjectVisual = True

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

        self.obj1520.GGLabel.setValue(5)
        self.obj1520.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(242.5, 132.5, self.obj1520)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1520.graphObject_ = new_obj

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

        self.obj1515.out_connections_.append(self.obj1518)
        self.obj1518.in_connections_.append(self.obj1515)
        self.obj1515.graphObject_.pendingConnections.append(
            (self.obj1515.graphObject_.tag, self.obj1518.graphObject_.tag,
             [117.0, 82.0, 143.0, 130.5], 2, 0))
        self.obj1515.out_connections_.append(self.obj1519)
        self.obj1519.in_connections_.append(self.obj1515)
        self.obj1515.graphObject_.pendingConnections.append(
            (self.obj1515.graphObject_.tag, self.obj1519.graphObject_.tag,
             [117.0, 82.0, 214.0, 83.5], 0, True))
        self.obj1517.out_connections_.append(self.obj1520)
        self.obj1520.in_connections_.append(self.obj1517)
        self.obj1517.graphObject_.pendingConnections.append(
            (self.obj1517.graphObject_.tag, self.obj1520.graphObject_.tag,
             [311.0, 85.0, 242.5, 132.5], 2, 0))
        self.obj1518.out_connections_.append(self.obj1516)
        self.obj1516.in_connections_.append(self.obj1518)
        self.obj1518.graphObject_.pendingConnections.append(
            (self.obj1518.graphObject_.tag, self.obj1516.graphObject_.tag,
             [191.0, 183.0, 143.0, 130.5], 2, 0))
        self.obj1519.out_connections_.append(self.obj1517)
        self.obj1517.in_connections_.append(self.obj1519)
        self.obj1519.graphObject_.pendingConnections.append(
            (self.obj1519.graphObject_.tag, self.obj1517.graphObject_.tag,
             [311.0, 85.0, 214.0, 83.5], 0, True))
        self.obj1520.out_connections_.append(self.obj1516)
        self.obj1516.in_connections_.append(self.obj1520)
        self.obj1520.graphObject_.pendingConnections.append(
            (self.obj1520.graphObject_.tag, self.obj1516.graphObject_.tag,
             [191.0, 183.0, 242.5, 132.5], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))

        role = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        return not (hasattr(agent, role.name.getValue())
                    and hasattr(role, agent.name.getValue()))

    def action(self, graphID, isograph, atom3i):
        ag = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        role = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        setattr(ag, role.name.getValue(), True)
        setattr(role, ag.name.getValue(), True)

        setattr(c1, ag.name.getValue(), True)
        setattr(c1, role.name.getValue(), True)

        print 'connCt (' + ag.name.getValue() + ',' + role.name.getValue(
        ) + ')'
        if not (ag.name.getValue() in self.graphRewritingSystem.Dictag.keys()):
            self.graphRewritingSystem.Dictag[ag.name.getValue()] = {}
        if not (c1.name.getValue() in self.graphRewritingSystem.Dictag[
                ag.name.getValue()].keys()):
            self.graphRewritingSystem.Dictag[ag.name.getValue()][
                c1.name.getValue()] = 0
        if not (role.name.getValue() in self.graphRewritingSystem.Dictag[
                ag.name.getValue()].keys()):
            self.graphRewritingSystem.Dictag[ag.name.getValue()][
                role.name.getValue()] = 0

        self.graphRewritingSystem.Dictag[ag.name.getValue()]['nb'] = 0

        print str(self.graphRewritingSystem.Dictag)
Exemplo n.º 4
0
class CollectInf1_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 4)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

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

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

        # price
        self.obj1568.price.setNone()

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

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

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

        self.obj1569 = Capabilitie(parent)
        self.obj1569.preAction(self.LHS.CREATE)
        self.obj1569.isGraphObjectVisual = True

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

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

        self.obj1569.GGLabel.setValue(3)
        self.obj1569.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(140.0, 160.0, self.obj1569)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1569.graphObject_ = new_obj

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

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

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

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

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

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

        self.obj1571 = posses(parent)
        self.obj1571.preAction(self.LHS.CREATE)
        self.obj1571.isGraphObjectVisual = True

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

        # rate
        self.obj1571.rate.setNone()

        self.obj1571.GGLabel.setValue(4)
        self.obj1571.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(78.5, 145.75, self.obj1571)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1571.graphObject_ = new_obj

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

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

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

        # rate
        self.obj1572.rate.setNone()

        self.obj1572.GGLabel.setValue(6)
        self.obj1572.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(295.25, 111.25, self.obj1572)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1572.graphObject_ = new_obj

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

        self.obj1573 = require(parent)
        self.obj1573.preAction(self.LHS.CREATE)
        self.obj1573.isGraphObjectVisual = True

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

        self.obj1573.GGLabel.setValue(5)
        self.obj1573.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(291.0, 171.5, self.obj1573)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1573.graphObject_ = new_obj

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

        self.obj1568.out_connections_.append(self.obj1571)
        self.obj1571.in_connections_.append(self.obj1568)
        self.obj1568.graphObject_.pendingConnections.append(
            (self.obj1568.graphObject_.tag, self.obj1571.graphObject_.tag,
             [45.0, 82.0, 49.5, 126.5, 78.5, 145.75], 2, True))
        self.obj1568.out_connections_.append(self.obj1572)
        self.obj1572.in_connections_.append(self.obj1568)
        self.obj1568.graphObject_.pendingConnections.append(
            (self.obj1568.graphObject_.tag, self.obj1572.graphObject_.tag,
             [45.0, 82.0, 205.5, 86.5, 295.25, 111.25], 2, True))
        self.obj1570.out_connections_.append(self.obj1573)
        self.obj1573.in_connections_.append(self.obj1570)
        self.obj1570.graphObject_.pendingConnections.append(
            (self.obj1570.graphObject_.tag, self.obj1573.graphObject_.tag,
             [404.0, 181.0, 374.0, 146.0, 291.0, 171.5], 2, True))
        self.obj1571.out_connections_.append(self.obj1569)
        self.obj1569.in_connections_.append(self.obj1571)
        self.obj1571.graphObject_.pendingConnections.append(
            (self.obj1571.graphObject_.tag, self.obj1569.graphObject_.tag,
             [161.0, 159.0, 107.5, 165.0, 78.5, 145.75], 2, True))
        self.obj1572.out_connections_.append(self.obj1570)
        self.obj1570.in_connections_.append(self.obj1572)
        self.obj1572.graphObject_.pendingConnections.append(
            (self.obj1572.graphObject_.tag, self.obj1570.graphObject_.tag,
             [404.0, 181.0, 385.0, 136.0, 295.25, 111.25], 2, True))
        self.obj1573.out_connections_.append(self.obj1569)
        self.obj1569.in_connections_.append(self.obj1573)
        self.obj1573.graphObject_.pendingConnections.append(
            (self.obj1573.graphObject_.tag, self.obj1569.graphObject_.tag,
             [161.0, 199.0, 208.0, 197.0, 291.0, 171.5], 2, True))

        self.RHS = ASG_omacs(parent)

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

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

        # price
        self.obj1575.price.setNone()

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

        self.obj1575.GGLabel.setValue(1)
        self.obj1575.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(20.0, 20.0, self.obj1575)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1575.graphObject_ = new_obj
        self.obj15750 = AttrCalc()
        self.obj15750.Copy = ATOM3Boolean()
        self.obj15750.Copy.setValue(('Copy from LHS', 1))
        self.obj15750.Copy.config = 0
        self.obj15750.Specify = ATOM3Constraint()
        self.obj15750.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.obj1575.GGset2Any['price'] = self.obj15750
        self.obj15751 = AttrCalc()
        self.obj15751.Copy = ATOM3Boolean()
        self.obj15751.Copy.setValue(('Copy from LHS', 1))
        self.obj15751.Copy.config = 0
        self.obj15751.Specify = ATOM3Constraint()
        self.obj15751.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.obj1575.GGset2Any['name'] = self.obj15751

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

        self.obj1576 = Capabilitie(parent)
        self.obj1576.preAction(self.RHS.CREATE)
        self.obj1576.isGraphObjectVisual = True

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

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

        self.obj1576.GGLabel.setValue(3)
        self.obj1576.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(140.0, 160.0, self.obj1576)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1576.graphObject_ = new_obj
        self.obj15760 = AttrCalc()
        self.obj15760.Copy = ATOM3Boolean()
        self.obj15760.Copy.setValue(('Copy from LHS', 1))
        self.obj15760.Copy.config = 0
        self.obj15760.Specify = ATOM3Constraint()
        self.obj15760.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.obj1576.GGset2Any['name'] = self.obj15760

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

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

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

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

        self.obj1577.GGLabel.setValue(2)
        self.obj1577.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(380.0, 180.0, self.obj1577)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1577.graphObject_ = new_obj
        self.obj15770 = AttrCalc()
        self.obj15770.Copy = ATOM3Boolean()
        self.obj15770.Copy.setValue(('Copy from LHS', 1))
        self.obj15770.Copy.config = 0
        self.obj15770.Specify = ATOM3Constraint()
        self.obj15770.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.obj1577.GGset2Any['name'] = self.obj15770

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

        self.obj1578 = posses(parent)
        self.obj1578.preAction(self.RHS.CREATE)
        self.obj1578.isGraphObjectVisual = True

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

        # rate
        self.obj1578.rate.setNone()

        self.obj1578.GGLabel.setValue(4)
        self.obj1578.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(78.5, 145.75, self.obj1578)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1578.graphObject_ = new_obj
        self.obj15780 = AttrCalc()
        self.obj15780.Copy = ATOM3Boolean()
        self.obj15780.Copy.setValue(('Copy from LHS', 1))
        self.obj15780.Copy.config = 0
        self.obj15780.Specify = ATOM3Constraint()
        self.obj15780.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.obj1578.GGset2Any['rate'] = self.obj15780

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

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

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

        # rate
        self.obj1579.rate.setNone()

        self.obj1579.GGLabel.setValue(6)
        self.obj1579.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(295.25, 111.25, self.obj1579)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1579.graphObject_ = new_obj
        self.obj15790 = AttrCalc()
        self.obj15790.Copy = ATOM3Boolean()
        self.obj15790.Copy.setValue(('Copy from LHS', 1))
        self.obj15790.Copy.config = 0
        self.obj15790.Specify = ATOM3Constraint()
        self.obj15790.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.obj1579.GGset2Any['rate'] = self.obj15790

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

        self.obj1580 = require(parent)
        self.obj1580.preAction(self.RHS.CREATE)
        self.obj1580.isGraphObjectVisual = True

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

        self.obj1580.GGLabel.setValue(5)
        self.obj1580.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(291.0, 171.5, self.obj1580)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1580.graphObject_ = new_obj

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

        self.obj1575.out_connections_.append(self.obj1578)
        self.obj1578.in_connections_.append(self.obj1575)
        self.obj1575.graphObject_.pendingConnections.append(
            (self.obj1575.graphObject_.tag, self.obj1578.graphObject_.tag,
             [57.0, 82.0, 78.5, 145.75], 2, 0))
        self.obj1575.out_connections_.append(self.obj1579)
        self.obj1579.in_connections_.append(self.obj1575)
        self.obj1575.graphObject_.pendingConnections.append(
            (self.obj1575.graphObject_.tag, self.obj1579.graphObject_.tag,
             [57.0, 82.0, 295.25, 111.25], 2, 0))
        self.obj1577.out_connections_.append(self.obj1580)
        self.obj1580.in_connections_.append(self.obj1577)
        self.obj1577.graphObject_.pendingConnections.append(
            (self.obj1577.graphObject_.tag, self.obj1580.graphObject_.tag,
             [411.0, 180.0, 291.0, 171.5], 2, 0))
        self.obj1578.out_connections_.append(self.obj1576)
        self.obj1576.in_connections_.append(self.obj1578)
        self.obj1578.graphObject_.pendingConnections.append(
            (self.obj1578.graphObject_.tag, self.obj1576.graphObject_.tag,
             [171.0, 163.0, 78.5, 145.75], 2, 0))
        self.obj1579.out_connections_.append(self.obj1577)
        self.obj1577.in_connections_.append(self.obj1579)
        self.obj1579.graphObject_.pendingConnections.append(
            (self.obj1579.graphObject_.tag, self.obj1577.graphObject_.tag,
             [411.0, 180.0, 295.25, 111.25], 2, 0))
        self.obj1580.out_connections_.append(self.obj1576)
        self.obj1576.in_connections_.append(self.obj1580)
        self.obj1580.graphObject_.pendingConnections.append(
            (self.obj1580.graphObject_.tag, self.obj1576.graphObject_.tag,
             [171.0, 163.0, 291.0, 171.5], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        role = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        link = self.getMatched(graphID, self.LHS.nodeWithLabel(5))

        return not (hasattr(
            link, "rule1" + agent.name.getValue() + role.name.getValue()))

    def action(self, graphID, isograph, atom3i):
        linkk = self.getMatched(graphID, self.LHS.nodeWithLabel(5))
        c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        a = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        r = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        link = self.getMatched(graphID, self.LHS.nodeWithLabel(4))

        setattr(linkk, "rule1" + a.name.getValue() + r.name.getValue(), True)

        print "Collect 1 " + a.name.getValue() + " " + r.name.getValue(
        ) + " " + str(link.rate.getValue()) + c1.name.getValue()
        if not ("nb" + r.name.getValue()
                in self.graphRewritingSystem.Dictag[a.name.getValue()].keys()):
            self.graphRewritingSystem.Dictag[a.name.getValue()][
                "nb" + r.name.getValue()] = 0

        self.graphRewritingSystem.Dictag[a.name.getValue()][
            "nb" + r.name.getValue()] += 1
        self.graphRewritingSystem.Dictag[a.name.getValue()][
            r.name.getValue()] += link.rate.getValue()
        self.graphRewritingSystem.Dictag[a.name.getValue()][
            c1.name.getValue()] = link.rate.getValue()
        print "Collect inf 1 " + str(self.graphRewritingSystem.Dictag)
class Agent2RoleLink2_GG_rule (GGrule):

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

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

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

      # price
      self.obj1525.price.setNone()

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

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

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

      self.obj1526=Capabilitie(parent)
      self.obj1526.preAction( self.LHS.CREATE )
      self.obj1526.isGraphObjectVisual = True

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

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

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

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

      self.obj1527=Capabilitie(parent)
      self.obj1527.preAction( self.LHS.CREATE )
      self.obj1527.isGraphObjectVisual = True

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

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

      self.obj1527.GGLabel.setValue(3)
      self.obj1527.graphClass_= graph_Capabilitie
      if parent.genGraphics:
         new_obj = graph_Capabilitie(300.0,20.0,self.obj1527)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1527.graphObject_ = new_obj

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

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

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

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

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

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

      self.obj1529=posses(parent)
      self.obj1529.preAction( self.LHS.CREATE )
      self.obj1529.isGraphObjectVisual = True

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

      # rate
      self.obj1529.rate.setNone()

      self.obj1529.GGLabel.setValue(5)
      self.obj1529.graphClass_= graph_posses
      if parent.genGraphics:
         new_obj = graph_posses(203.0,70.5,self.obj1529)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1529.graphObject_ = new_obj

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

      self.obj1530=posses(parent)
      self.obj1530.preAction( self.LHS.CREATE )
      self.obj1530.isGraphObjectVisual = True

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

      # rate
      self.obj1530.rate.setNone()

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

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

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

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

      # rate
      self.obj1531.rate.setNone()

      self.obj1531.GGLabel.setValue(9)
      self.obj1531.graphClass_= graph_CapableOf
      if parent.genGraphics:
         new_obj = graph_CapableOf(209.5,129.5,self.obj1531)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1531.graphObject_ = new_obj

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

      self.obj1532=require(parent)
      self.obj1532.preAction( self.LHS.CREATE )
      self.obj1532.isGraphObjectVisual = True

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

      self.obj1532.GGLabel.setValue(7)
      self.obj1532.graphClass_= graph_require
      if parent.genGraphics:
         new_obj = graph_require(222.5,180.0,self.obj1532)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1532.graphObject_ = new_obj

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

      self.obj1533=require(parent)
      self.obj1533.preAction( self.LHS.CREATE )
      self.obj1533.isGraphObjectVisual = True

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

      self.obj1533.GGLabel.setValue(8)
      self.obj1533.graphClass_= graph_require
      if parent.genGraphics:
         new_obj = graph_require(332.5,120.0,self.obj1533)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1533.graphObject_ = new_obj

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

      self.obj1525.out_connections_.append(self.obj1529)
      self.obj1529.in_connections_.append(self.obj1525)
      self.obj1525.out_connections_.append(self.obj1530)
      self.obj1530.in_connections_.append(self.obj1525)
      self.obj1525.graphObject_.pendingConnections.append((self.obj1525.graphObject_.tag, self.obj1530.graphObject_.tag, [85.0, 82.0, 93.0, 130.5], 0, True))
      self.obj1525.out_connections_.append(self.obj1531)
      self.obj1531.in_connections_.append(self.obj1525)
      self.obj1525.graphObject_.pendingConnections.append((self.obj1525.graphObject_.tag, self.obj1531.graphObject_.tag, [85.0, 82.0, 163.0, 138.0, 209.5, 129.5], 2, True))
      self.obj1528.out_connections_.append(self.obj1532)
      self.obj1532.in_connections_.append(self.obj1528)
      self.obj1528.graphObject_.pendingConnections.append((self.obj1528.graphObject_.tag, self.obj1532.graphObject_.tag, [344.0, 181.0, 222.5, 180.0], 0, True))
      self.obj1528.out_connections_.append(self.obj1533)
      self.obj1533.in_connections_.append(self.obj1528)
      self.obj1528.graphObject_.pendingConnections.append((self.obj1528.graphObject_.tag, self.obj1533.graphObject_.tag, [344.0, 181.0, 332.5, 120.0], 0, True))
      self.obj1529.out_connections_.append(self.obj1527)
      self.obj1527.in_connections_.append(self.obj1529)
      self.obj1529.graphObject_.pendingConnections.append((self.obj1529.graphObject_.tag, self.obj1527.graphObject_.tag, [321.0, 59.0, 203.0, 70.5], 0, True))
      self.obj1530.out_connections_.append(self.obj1526)
      self.obj1526.in_connections_.append(self.obj1530)
      self.obj1530.graphObject_.pendingConnections.append((self.obj1530.graphObject_.tag, self.obj1526.graphObject_.tag, [101.0, 179.0, 93.0, 130.5], 0, True))
      self.obj1531.out_connections_.append(self.obj1528)
      self.obj1528.in_connections_.append(self.obj1531)
      self.obj1531.graphObject_.pendingConnections.append((self.obj1531.graphObject_.tag, self.obj1528.graphObject_.tag, [344.0, 181.0, 256.0, 121.0, 209.5, 129.5], 2, True))
      self.obj1532.out_connections_.append(self.obj1526)
      self.obj1526.in_connections_.append(self.obj1532)
      self.obj1532.graphObject_.pendingConnections.append((self.obj1532.graphObject_.tag, self.obj1526.graphObject_.tag, [101.0, 179.0, 222.5, 180.0], 0, True))
      self.obj1533.out_connections_.append(self.obj1527)
      self.obj1527.in_connections_.append(self.obj1533)

      self.RHS = ASG_omacs(parent)

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

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

      # price
      self.obj1535.price.setNone()

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

      self.obj1535.GGLabel.setValue(1)
      self.obj1535.graphClass_= graph_Agent
      if parent.genGraphics:
         new_obj = graph_Agent(60.0,20.0,self.obj1535)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1535.graphObject_ = new_obj
      self.obj15350= AttrCalc()
      self.obj15350.Copy=ATOM3Boolean()
      self.obj15350.Copy.setValue(('Copy from LHS', 1))
      self.obj15350.Copy.config = 0
      self.obj15350.Specify=ATOM3Constraint()
      self.obj15350.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.obj1535.GGset2Any['price']= self.obj15350
      self.obj15351= AttrCalc()
      self.obj15351.Copy=ATOM3Boolean()
      self.obj15351.Copy.setValue(('Copy from LHS', 1))
      self.obj15351.Copy.config = 0
      self.obj15351.Specify=ATOM3Constraint()
      self.obj15351.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.obj1535.GGset2Any['name']= self.obj15351

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

      self.obj1536=Capabilitie(parent)
      self.obj1536.preAction( self.RHS.CREATE )
      self.obj1536.isGraphObjectVisual = True

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

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

      self.obj1536.GGLabel.setValue(2)
      self.obj1536.graphClass_= graph_Capabilitie
      if parent.genGraphics:
         new_obj = graph_Capabilitie(80.0,180.0,self.obj1536)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1536.graphObject_ = new_obj
      self.obj15360= AttrCalc()
      self.obj15360.Copy=ATOM3Boolean()
      self.obj15360.Copy.setValue(('Copy from LHS', 1))
      self.obj15360.Copy.config = 0
      self.obj15360.Specify=ATOM3Constraint()
      self.obj15360.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.obj1536.GGset2Any['name']= self.obj15360

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

      self.obj1537=Capabilitie(parent)
      self.obj1537.preAction( self.RHS.CREATE )
      self.obj1537.isGraphObjectVisual = True

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

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

      self.obj1537.GGLabel.setValue(3)
      self.obj1537.graphClass_= graph_Capabilitie
      if parent.genGraphics:
         new_obj = graph_Capabilitie(300.0,20.0,self.obj1537)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1537.graphObject_ = new_obj
      self.obj15370= AttrCalc()
      self.obj15370.Copy=ATOM3Boolean()
      self.obj15370.Copy.setValue(('Copy from LHS', 1))
      self.obj15370.Copy.config = 0
      self.obj15370.Specify=ATOM3Constraint()
      self.obj15370.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.obj1537.GGset2Any['name']= self.obj15370

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

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

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

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

      self.obj1538.GGLabel.setValue(4)
      self.obj1538.graphClass_= graph_Role
      if parent.genGraphics:
         new_obj = graph_Role(320.0,180.0,self.obj1538)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1538.graphObject_ = new_obj
      self.obj15380= AttrCalc()
      self.obj15380.Copy=ATOM3Boolean()
      self.obj15380.Copy.setValue(('Copy from LHS', 1))
      self.obj15380.Copy.config = 0
      self.obj15380.Specify=ATOM3Constraint()
      self.obj15380.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.obj1538.GGset2Any['name']= self.obj15380

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

      self.obj1539=posses(parent)
      self.obj1539.preAction( self.RHS.CREATE )
      self.obj1539.isGraphObjectVisual = True

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

      # rate
      self.obj1539.rate.setNone()

      self.obj1539.GGLabel.setValue(5)
      self.obj1539.graphClass_= graph_posses
      if parent.genGraphics:
         new_obj = graph_posses(203.0,70.5,self.obj1539)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1539.graphObject_ = new_obj
      self.obj15390= AttrCalc()
      self.obj15390.Copy=ATOM3Boolean()
      self.obj15390.Copy.setValue(('Copy from LHS', 1))
      self.obj15390.Copy.config = 0
      self.obj15390.Specify=ATOM3Constraint()
      self.obj15390.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.obj1539.GGset2Any['rate']= self.obj15390

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

      self.obj1540=posses(parent)
      self.obj1540.preAction( self.RHS.CREATE )
      self.obj1540.isGraphObjectVisual = True

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

      # rate
      self.obj1540.rate.setNone()

      self.obj1540.GGLabel.setValue(6)
      self.obj1540.graphClass_= graph_posses
      if parent.genGraphics:
         new_obj = graph_posses(93.0,130.5,self.obj1540)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
         new_obj.layConstraints['scale'] = [1.0, 1.0]
      else: new_obj = None
      self.obj1540.graphObject_ = new_obj
      self.obj15400= AttrCalc()
      self.obj15400.Copy=ATOM3Boolean()
      self.obj15400.Copy.setValue(('Copy from LHS', 1))
      self.obj15400.Copy.config = 0
      self.obj15400.Specify=ATOM3Constraint()
      self.obj15400.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.obj1540.GGset2Any['rate']= self.obj15400

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

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

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

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

      self.obj1541.GGLabel.setValue(9)
      self.obj1541.graphClass_= graph_CapableOf
      if parent.genGraphics:
         new_obj = graph_CapableOf(209.5,129.5,self.obj1541)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1541.graphObject_ = new_obj
      self.obj15410= AttrCalc()
      self.obj15410.Copy=ATOM3Boolean()
      self.obj15410.Copy.setValue(('Copy from LHS', 1))
      self.obj15410.Copy.config = 0
      self.obj15410.Specify=ATOM3Constraint()
      self.obj15410.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.obj1541.GGset2Any['rate']= self.obj15410

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

      self.obj1542=require(parent)
      self.obj1542.preAction( self.RHS.CREATE )
      self.obj1542.isGraphObjectVisual = True

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

      self.obj1542.GGLabel.setValue(7)
      self.obj1542.graphClass_= graph_require
      if parent.genGraphics:
         new_obj = graph_require(222.5,180.0,self.obj1542)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1542.graphObject_ = new_obj

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

      self.obj1543=require(parent)
      self.obj1543.preAction( self.RHS.CREATE )
      self.obj1543.isGraphObjectVisual = True

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

      self.obj1543.GGLabel.setValue(8)
      self.obj1543.graphClass_= graph_require
      if parent.genGraphics:
         new_obj = graph_require(332.5,120.0,self.obj1543)
         new_obj.layConstraints = dict() # Graphical Layout Constraints 
      else: new_obj = None
      self.obj1543.graphObject_ = new_obj

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

      self.obj1535.out_connections_.append(self.obj1539)
      self.obj1539.in_connections_.append(self.obj1535)
      self.obj1535.out_connections_.append(self.obj1540)
      self.obj1540.in_connections_.append(self.obj1535)
      self.obj1535.graphObject_.pendingConnections.append((self.obj1535.graphObject_.tag, self.obj1540.graphObject_.tag, [97.0, 82.0, 93.0, 130.5], 2, 0))
      self.obj1535.out_connections_.append(self.obj1541)
      self.obj1541.in_connections_.append(self.obj1535)
      self.obj1535.graphObject_.pendingConnections.append((self.obj1535.graphObject_.tag, self.obj1541.graphObject_.tag, [97.0, 82.0, 209.5, 129.5], 2, 0))
      self.obj1538.out_connections_.append(self.obj1542)
      self.obj1542.in_connections_.append(self.obj1538)
      self.obj1538.graphObject_.pendingConnections.append((self.obj1538.graphObject_.tag, self.obj1542.graphObject_.tag, [351.0, 180.0, 222.5, 180.0], 2, 0))
      self.obj1538.out_connections_.append(self.obj1543)
      self.obj1543.in_connections_.append(self.obj1538)
      self.obj1538.graphObject_.pendingConnections.append((self.obj1538.graphObject_.tag, self.obj1543.graphObject_.tag, [351.0, 180.0, 332.5, 120.0], 2, 0))
      self.obj1539.out_connections_.append(self.obj1537)
      self.obj1537.in_connections_.append(self.obj1539)
      self.obj1539.graphObject_.pendingConnections.append((self.obj1539.graphObject_.tag, self.obj1537.graphObject_.tag, [331.0, 63.0, 203.0, 70.5], 2, 0))
      self.obj1540.out_connections_.append(self.obj1536)
      self.obj1536.in_connections_.append(self.obj1540)
      self.obj1540.graphObject_.pendingConnections.append((self.obj1540.graphObject_.tag, self.obj1536.graphObject_.tag, [111.0, 183.0, 93.0, 130.5], 2, 0))
      self.obj1541.out_connections_.append(self.obj1538)
      self.obj1538.in_connections_.append(self.obj1541)
      self.obj1541.graphObject_.pendingConnections.append((self.obj1541.graphObject_.tag, self.obj1538.graphObject_.tag, [351.0, 180.0, 209.5, 129.5], 2, 0))
      self.obj1542.out_connections_.append(self.obj1536)
      self.obj1536.in_connections_.append(self.obj1542)
      self.obj1542.graphObject_.pendingConnections.append((self.obj1542.graphObject_.tag, self.obj1536.graphObject_.tag, [111.0, 183.0, 222.5, 180.0], 2, 0))
      self.obj1543.out_connections_.append(self.obj1537)
      self.obj1537.in_connections_.append(self.obj1543)

   def condition(self, graphID, isograph, atom3i):
      
      agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
      c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
      c2 = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
      role = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
      
      return not ( hasattr(c1, agent.name.getValue() ) and 
      hasattr(c1, role.name.getValue() ) and
      hasattr(c2, agent.name.getValue() ) and  hasattr(c2,  role.name.getValue()  ) )
      

   def action(self, graphID, isograph, atom3i):
      agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
      c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
      c2 = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
      role = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
      
      setattr( c1 ,  agent.name.getValue() , True )
      setattr( c1 ,  role.name.getValue() , True )
      
      setattr( c2 ,  agent.name.getValue() , True )
      setattr( c2 ,  role.name.getValue() , True )
      print' Mark :('+agent.name.getValue()+','+c1.name.getValue()+','+c2.name.getValue()+','+role.name.getValue()+')'
Exemplo n.º 6
0
class CollectInf2_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 5)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

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

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

        # price
        self.obj1585.price.setNone()

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

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

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

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

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

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

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

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

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

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

        # rate
        self.obj1587.rate.setNone()

        self.obj1587.GGLabel.setValue(3)
        self.obj1587.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(220.0, 114.5, self.obj1587)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1587.graphObject_ = new_obj

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

        self.obj1585.out_connections_.append(self.obj1587)
        self.obj1587.in_connections_.append(self.obj1585)
        self.obj1585.graphObject_.pendingConnections.append(
            (self.obj1585.graphObject_.tag, self.obj1587.graphObject_.tag,
             [65.0, 82.0, 84.0, 138.0, 220.0, 114.5], 2, True))
        self.obj1587.out_connections_.append(self.obj1586)
        self.obj1586.in_connections_.append(self.obj1587)
        self.obj1587.graphObject_.pendingConnections.append(
            (self.obj1587.graphObject_.tag, self.obj1586.graphObject_.tag,
             [384.0, 161.0, 356.0, 91.0, 220.0, 114.5], 2, True))

        self.RHS = ASG_omacs(parent)

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

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

        # price
        self.obj1589.price.setNone()

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

        self.obj1589.GGLabel.setValue(1)
        self.obj1589.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(40.0, 20.0, self.obj1589)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1589.graphObject_ = new_obj
        self.obj15890 = AttrCalc()
        self.obj15890.Copy = ATOM3Boolean()
        self.obj15890.Copy.setValue(('Copy from LHS', 1))
        self.obj15890.Copy.config = 0
        self.obj15890.Specify = ATOM3Constraint()
        self.obj15890.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.obj1589.GGset2Any['price'] = self.obj15890
        self.obj15891 = AttrCalc()
        self.obj15891.Copy = ATOM3Boolean()
        self.obj15891.Copy.setValue(('Copy from LHS', 1))
        self.obj15891.Copy.config = 0
        self.obj15891.Specify = ATOM3Constraint()
        self.obj15891.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.obj1589.GGset2Any['name'] = self.obj15891

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

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

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

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

        self.obj1590.GGLabel.setValue(2)
        self.obj1590.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(360.0, 160.0, self.obj1590)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1590.graphObject_ = new_obj
        self.obj15900 = AttrCalc()
        self.obj15900.Copy = ATOM3Boolean()
        self.obj15900.Copy.setValue(('Copy from LHS', 1))
        self.obj15900.Copy.config = 0
        self.obj15900.Specify = ATOM3Constraint()
        self.obj15900.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.obj1590.GGset2Any['name'] = self.obj15900

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

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

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

        # rate
        self.obj1591.rate.setNone()

        self.obj1591.GGLabel.setValue(3)
        self.obj1591.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(220.0, 114.5, self.obj1591)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1591.graphObject_ = new_obj
        self.obj15910 = AttrCalc()
        self.obj15910.Copy = ATOM3Boolean()
        self.obj15910.Copy.setValue(('Copy from LHS', 1))
        self.obj15910.Copy.config = 0
        self.obj15910.Specify = ATOM3Constraint()
        self.obj15910.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.obj1591.GGset2Any['rate'] = self.obj15910

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

        self.obj1589.out_connections_.append(self.obj1591)
        self.obj1591.in_connections_.append(self.obj1589)
        self.obj1589.graphObject_.pendingConnections.append(
            (self.obj1589.graphObject_.tag, self.obj1591.graphObject_.tag,
             [77.0, 82.0, 220.0, 114.5], 2, 0))
        self.obj1591.out_connections_.append(self.obj1590)
        self.obj1590.in_connections_.append(self.obj1591)
        self.obj1591.graphObject_.pendingConnections.append(
            (self.obj1591.graphObject_.tag, self.obj1590.graphObject_.tag,
             [391.0, 160.0, 220.0, 114.5], 2, 0))

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

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

        link.done = True

        print "Collect 2 " + a.name.getValue() + " " + r.name.getValue(
        ) + " " + str(link.rate.getValue())

        self.graphRewritingSystem.Dictag[a.name.getValue()][
            r.name.getValue()] /= self.graphRewritingSystem.Dictag[
                a.name.getValue()]["nb" + r.name.getValue()]
        round(
            self.graphRewritingSystem.Dictag[a.name.getValue()][
                r.name.getValue()], 3)
        print "Collect 2  : " + str(self.graphRewritingSystem.Dictag)
Exemplo n.º 7
0
class TransAgent2Raw_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 9)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

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

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

        # price
        self.obj1607.price.setNone()

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

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

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

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

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

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

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

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

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

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

        # rate
        self.obj1609.rate.setNone()

        self.obj1609.GGLabel.setValue(3)
        self.obj1609.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(281.5, 134.0, self.obj1609)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1609.graphObject_ = new_obj

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

        self.obj1607.out_connections_.append(self.obj1609)
        self.obj1609.in_connections_.append(self.obj1607)
        self.obj1607.graphObject_.pendingConnections.append(
            (self.obj1607.graphObject_.tag, self.obj1609.graphObject_.tag,
             [125.0, 82.0, 161.0, 153.0, 281.5, 134.0], 2, True))
        self.obj1609.out_connections_.append(self.obj1608)
        self.obj1608.in_connections_.append(self.obj1609)
        self.obj1609.graphObject_.pendingConnections.append(
            (self.obj1609.graphObject_.tag, self.obj1608.graphObject_.tag,
             [384.0, 161.0, 402.0, 115.0, 281.5, 134.0], 2, True))

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

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

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

        # price
        self.obj1613.price.setNone()

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

        self.obj1613.GGLabel.setValue(1)
        self.obj1613.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(100.0, 20.0, self.obj1613)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1613.graphObject_ = new_obj
        self.obj16130 = AttrCalc()
        self.obj16130.Copy = ATOM3Boolean()
        self.obj16130.Copy.setValue(('Copy from LHS', 1))
        self.obj16130.Copy.config = 0
        self.obj16130.Specify = ATOM3Constraint()
        self.obj16130.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.obj1613.GGset2Any['price'] = self.obj16130
        self.obj16131 = AttrCalc()
        self.obj16131.Copy = ATOM3Boolean()
        self.obj16131.Copy.setValue(('Copy from LHS', 1))
        self.obj16131.Copy.config = 0
        self.obj16131.Specify = ATOM3Constraint()
        self.obj16131.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.obj1613.GGset2Any['name'] = self.obj16131

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

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

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

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

        self.obj1614.GGLabel.setValue(2)
        self.obj1614.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(360.0, 160.0, self.obj1614)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1614.graphObject_ = new_obj
        self.obj16140 = AttrCalc()
        self.obj16140.Copy = ATOM3Boolean()
        self.obj16140.Copy.setValue(('Copy from LHS', 1))
        self.obj16140.Copy.config = 0
        self.obj16140.Specify = ATOM3Constraint()
        self.obj16140.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.obj1614.GGset2Any['name'] = self.obj16140

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

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

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

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

        self.obj1615.GGLabel.setValue(3)
        self.obj1615.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(281.5, 134.0, self.obj1615)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1615.graphObject_ = new_obj
        self.obj16150 = AttrCalc()
        self.obj16150.Copy = ATOM3Boolean()
        self.obj16150.Copy.setValue(('Copy from LHS', 1))
        self.obj16150.Copy.config = 0
        self.obj16150.Specify = ATOM3Constraint()
        self.obj16150.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.obj1615.GGset2Any['rate'] = self.obj16150

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

        self.obj1616 = rawMaterial(parent)
        self.obj1616.preAction(self.RHS.CREATE)
        self.obj1616.isGraphObjectVisual = True

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

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

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

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

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

        self.obj1616.GGLabel.setValue(6)
        self.obj1616.graphClass_ = graph_rawMaterial
        if parent.genGraphics:
            new_obj = graph_rawMaterial(280.0, 20.0, self.obj1616)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1616.graphObject_ = new_obj
        self.obj16160 = AttrCalc()
        self.obj16160.Copy = ATOM3Boolean()
        self.obj16160.Copy.setValue(('Copy from LHS', 1))
        self.obj16160.Copy.config = 0
        self.obj16160.Specify = ATOM3Constraint()
        self.obj16160.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.obj1616.GGset2Any['MaxFlow'] = self.obj16160
        self.obj16161 = AttrCalc()
        self.obj16161.Copy = ATOM3Boolean()
        self.obj16161.Copy.setValue(('Copy from LHS', 1))
        self.obj16161.Copy.config = 0
        self.obj16161.Specify = ATOM3Constraint()
        self.obj16161.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.obj1616.GGset2Any['price'] = self.obj16161
        self.obj16162 = AttrCalc()
        self.obj16162.Copy = ATOM3Boolean()
        self.obj16162.Copy.setValue(('Copy from LHS', 0))
        self.obj16162.Copy.config = 0
        self.obj16162.Specify = ATOM3Constraint()
        self.obj16162.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\n\n\n'
             ))
        self.obj1616.GGset2Any['Name'] = self.obj16162
        self.obj16163 = AttrCalc()
        self.obj16163.Copy = ATOM3Boolean()
        self.obj16163.Copy.setValue(('Copy from LHS', 1))
        self.obj16163.Copy.config = 0
        self.obj16163.Specify = ATOM3Constraint()
        self.obj16163.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.obj1616.GGset2Any['ReqFlow'] = self.obj16163

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

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

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

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

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

        self.obj1613.out_connections_.append(self.obj1615)
        self.obj1615.in_connections_.append(self.obj1613)
        self.obj1613.graphObject_.pendingConnections.append(
            (self.obj1613.graphObject_.tag, self.obj1615.graphObject_.tag,
             [137.0, 82.0, 281.5, 134.0], 2, 0))
        self.obj1613.out_connections_.append(self.obj1617)
        self.obj1617.in_connections_.append(self.obj1613)
        self.obj1613.graphObject_.pendingConnections.append(
            (self.obj1613.graphObject_.tag, self.obj1617.graphObject_.tag,
             [137.0, 82.0, 220.5, 79.0], 0, True))
        self.obj1615.out_connections_.append(self.obj1614)
        self.obj1614.in_connections_.append(self.obj1615)
        self.obj1615.graphObject_.pendingConnections.append(
            (self.obj1615.graphObject_.tag, self.obj1614.graphObject_.tag,
             [391.0, 160.0, 281.5, 134.0], 2, 0))
        self.obj1617.out_connections_.append(self.obj1616)
        self.obj1616.in_connections_.append(self.obj1617)
        self.obj1617.graphObject_.pendingConnections.append(
            (self.obj1617.graphObject_.tag, self.obj1616.graphObject_.tag,
             [304.0, 76.0, 220.5, 79.0], 0, True))

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

        print "Dic ro " + str(self.graphRewritingSystem.Dictro)
        print "Dic ag" + str(self.graphRewritingSystem.Dictag)

        node = self.getMatched(graphID, self.LHS.nodeWithLabel(1))

        return not hasattr(node, "Agent2Raw")

    def action(self, graphID, isograph, atom3i):
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(1))
        node.Agent2Raw = True
Exemplo n.º 8
0
class AssignCost4AR_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 23)
        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.obj1796 = operatingUnit(parent)
        self.obj1796.preAction(self.LHS.CREATE)
        self.obj1796.isGraphObjectVisual = True

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

        # OperCostProp
        self.obj1796.OperCostProp.setNone()

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

        # OperCostFix
        self.obj1796.OperCostFix.setNone()

        self.obj1796.GGLabel.setValue(4)
        self.obj1796.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(280.0, 120.0, self.obj1796)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1796.graphObject_ = new_obj

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

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

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

        # rate
        self.obj1797.rate.setNone()

        self.obj1797.GGLabel.setValue(5)
        self.obj1797.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(160.5, 121.5, self.obj1797)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1797.graphObject_ = new_obj

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

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

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

        # price
        self.obj1798.price.setNone()

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

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

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

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

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

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

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

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

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

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

        self.obj1800.GGLabel.setValue(3)
        self.obj1800.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(264.75, 85.25, self.obj1800)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1800.graphObject_ = new_obj

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

        self.obj1797.out_connections_.append(self.obj1799)
        self.obj1799.in_connections_.append(self.obj1797)
        self.obj1797.graphObject_.pendingConnections.append(
            (self.obj1797.graphObject_.tag, self.obj1799.graphObject_.tag,
             [164.0, 141.0, 160.5, 121.5], 0, True))
        self.obj1798.out_connections_.append(self.obj1800)
        self.obj1800.in_connections_.append(self.obj1798)
        self.obj1798.graphObject_.pendingConnections.append(
            (self.obj1798.graphObject_.tag, self.obj1800.graphObject_.tag,
             [145.0, 102.0, 226.0, 83.0, 264.75, 85.25], 2, True))
        self.obj1798.out_connections_.append(self.obj1797)
        self.obj1797.in_connections_.append(self.obj1798)
        self.obj1798.graphObject_.pendingConnections.append(
            (self.obj1798.graphObject_.tag, self.obj1797.graphObject_.tag,
             [157.0, 102.0, 160.5, 121.5], 0, True))
        self.obj1800.out_connections_.append(self.obj1796)
        self.obj1796.in_connections_.append(self.obj1800)
        self.obj1800.graphObject_.pendingConnections.append(
            (self.obj1800.graphObject_.tag, self.obj1796.graphObject_.tag,
             [300.0, 121.0, 264.75, 85.25], 2, 0))

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

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

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

        # OperCostProp
        self.obj1804.OperCostProp.setNone()

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

        # OperCostFix
        self.obj1804.OperCostFix.setNone()

        self.obj1804.GGLabel.setValue(4)
        self.obj1804.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(280.0, 120.0, self.obj1804)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1804.graphObject_ = new_obj
        self.obj18040 = AttrCalc()
        self.obj18040.Copy = ATOM3Boolean()
        self.obj18040.Copy.setValue(('Copy from LHS', 0))
        self.obj18040.Copy.config = 0
        self.obj18040.Specify = ATOM3Constraint()
        self.obj18040.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]),
             'a = self.getMatched ( graphID , self.LHS.nodeWithLabel(1) ).name.getValue()\nb = self.getMatched ( graphID , self.LHS.nodeWithLabel(2) ).name.getValue()\nreturn self.graphRewritingSystem.Dictag[ a ][b]\n\n'
             ))
        self.obj1804.GGset2Any['OperCostProp'] = self.obj18040
        self.obj18041 = AttrCalc()
        self.obj18041.Copy = ATOM3Boolean()
        self.obj18041.Copy.setValue(('Copy from LHS', 1))
        self.obj18041.Copy.config = 0
        self.obj18041.Specify = ATOM3Constraint()
        self.obj18041.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.obj1804.GGset2Any['name'] = self.obj18041
        self.obj18042 = AttrCalc()
        self.obj18042.Copy = ATOM3Boolean()
        self.obj18042.Copy.setValue(('Copy from LHS', 0))
        self.obj18042.Copy.config = 0
        self.obj18042.Specify = ATOM3Constraint()
        self.obj18042.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.obj1804.GGset2Any['OperCostFix'] = self.obj18042

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

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

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

        # rate
        self.obj1805.rate.setNone()

        self.obj1805.GGLabel.setValue(5)
        self.obj1805.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(160.5, 121.5, self.obj1805)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1805.graphObject_ = new_obj
        self.obj18050 = AttrCalc()
        self.obj18050.Copy = ATOM3Boolean()
        self.obj18050.Copy.setValue(('Copy from LHS', 1))
        self.obj18050.Copy.config = 0
        self.obj18050.Specify = ATOM3Constraint()
        self.obj18050.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.obj1805.GGset2Any['rate'] = self.obj18050

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

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

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

        # price
        self.obj1806.price.setNone()

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

        self.obj1806.GGLabel.setValue(1)
        self.obj1806.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(120.0, 40.0, self.obj1806)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1806.graphObject_ = new_obj
        self.obj18060 = AttrCalc()
        self.obj18060.Copy = ATOM3Boolean()
        self.obj18060.Copy.setValue(('Copy from LHS', 1))
        self.obj18060.Copy.config = 0
        self.obj18060.Specify = ATOM3Constraint()
        self.obj18060.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.obj1806.GGset2Any['price'] = self.obj18060
        self.obj18061 = AttrCalc()
        self.obj18061.Copy = ATOM3Boolean()
        self.obj18061.Copy.setValue(('Copy from LHS', 1))
        self.obj18061.Copy.config = 0
        self.obj18061.Specify = ATOM3Constraint()
        self.obj18061.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.obj1806.GGset2Any['name'] = self.obj18061

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

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

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

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

        self.obj1807.GGLabel.setValue(2)
        self.obj1807.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(140.0, 140.0, self.obj1807)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1807.graphObject_ = new_obj
        self.obj18070 = AttrCalc()
        self.obj18070.Copy = ATOM3Boolean()
        self.obj18070.Copy.setValue(('Copy from LHS', 1))
        self.obj18070.Copy.config = 0
        self.obj18070.Specify = ATOM3Constraint()
        self.obj18070.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.obj1807.GGset2Any['name'] = self.obj18070

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

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

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

        self.obj1808.GGLabel.setValue(3)
        self.obj1808.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(264.75, 85.25, self.obj1808)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1808.graphObject_ = new_obj

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

        self.obj1805.out_connections_.append(self.obj1807)
        self.obj1807.in_connections_.append(self.obj1805)
        self.obj1805.graphObject_.pendingConnections.append(
            (self.obj1805.graphObject_.tag, self.obj1807.graphObject_.tag,
             [171.0, 140.0, 160.5, 121.5], 2, 0))
        self.obj1806.out_connections_.append(self.obj1808)
        self.obj1808.in_connections_.append(self.obj1806)
        self.obj1806.graphObject_.pendingConnections.append(
            (self.obj1806.graphObject_.tag, self.obj1808.graphObject_.tag,
             [157.0, 102.0, 264.75, 85.25], 2, 0))
        self.obj1806.out_connections_.append(self.obj1805)
        self.obj1805.in_connections_.append(self.obj1806)
        self.obj1806.graphObject_.pendingConnections.append(
            (self.obj1806.graphObject_.tag, self.obj1805.graphObject_.tag,
             [157.0, 102.0, 160.5, 121.5], 2, 0))
        self.obj1808.out_connections_.append(self.obj1804)
        self.obj1804.in_connections_.append(self.obj1808)
        self.obj1808.graphObject_.pendingConnections.append(
            (self.obj1808.graphObject_.tag, self.obj1804.graphObject_.tag,
             [300.0, 121.0, 264.75, 85.25], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        AR = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
        return not (hasattr(AR, "AssignCost"))

    def action(self, graphID, isograph, atom3i):
        AR = self.getMatched(graphID, self.LHS.nodeWithLabel(4))
        AR.AssignCost = True
        print '######################## Assign Cost for ' + AR.name.getValue()
Exemplo n.º 9
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
Exemplo n.º 10
0
class CreateLinkAR2Mat_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 21)
        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.obj1747 = rawMaterial(parent)
        self.obj1747.preAction(self.LHS.CREATE)
        self.obj1747.isGraphObjectVisual = True

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

        # MaxFlow
        self.obj1747.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1747.ReqFlow.setNone()

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

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

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

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

        # MaxFlow
        self.obj1748.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1748.ReqFlow.setNone()

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

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

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

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

        # OperCostProp
        self.obj1749.OperCostProp.setNone()

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

        # OperCostFix
        self.obj1749.OperCostFix.setNone()

        self.obj1749.GGLabel.setValue(7)
        self.obj1749.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(280.0, 100.0, self.obj1749)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1749.graphObject_ = new_obj

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

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

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

        # OperCostProp
        self.obj1750.OperCostProp.setNone()

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

        # OperCostFix
        self.obj1750.OperCostFix.setNone()

        self.obj1750.GGLabel.setValue(12)
        self.obj1750.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(360.0, 260.0, self.obj1750)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1750.graphObject_ = new_obj

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

        self.obj1751 = fromRaw(parent)
        self.obj1751.preAction(self.LHS.CREATE)
        self.obj1751.isGraphObjectVisual = True

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

        # rate
        self.obj1751.rate.setNone()

        self.obj1751.GGLabel.setValue(8)
        self.obj1751.graphClass_ = graph_fromRaw
        if parent.genGraphics:
            new_obj = graph_fromRaw(311.5, 63.25, self.obj1751)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1751.graphObject_ = new_obj

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

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

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

        # rate
        self.obj1752.rate.setNone()

        self.obj1752.GGLabel.setValue(14)
        self.obj1752.graphClass_ = graph_fromMaterial
        if parent.genGraphics:
            new_obj = graph_fromMaterial(379.5, 235.25, self.obj1752)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1752.graphObject_ = new_obj

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

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

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

        # rate
        self.obj1753.rate.setNone()

        self.obj1753.GGLabel.setValue(3)
        self.obj1753.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(84.5, 131.5, self.obj1753)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1753.graphObject_ = new_obj

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

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

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

        # price
        self.obj1754.price.setNone()

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

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

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

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

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

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

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

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

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

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

        self.obj1756.GGLabel.setValue(15)
        self.obj1756.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(174.5, 69.0, self.obj1756)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1756.graphObject_ = new_obj

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

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

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

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

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

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

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

        self.obj1758.GGLabel.setValue(13)
        self.obj1758.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(175.0, 234.0, self.obj1758)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1758.graphObject_ = new_obj

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

        self.obj1747.out_connections_.append(self.obj1751)
        self.obj1751.in_connections_.append(self.obj1747)
        self.obj1747.graphObject_.pendingConnections.append(
            (self.obj1747.graphObject_.tag, self.obj1751.graphObject_.tag,
             [264.0, 56.0, 295.0, 49.5, 311.5, 63.25], 2, True))
        self.obj1748.out_connections_.append(self.obj1752)
        self.obj1752.in_connections_.append(self.obj1748)
        self.obj1748.graphObject_.pendingConnections.append(
            (self.obj1748.graphObject_.tag, self.obj1752.graphObject_.tag,
             [306.0, 210.0, 353.5, 220.0, 379.5, 235.25], 2, True))
        self.obj1751.out_connections_.append(self.obj1749)
        self.obj1749.in_connections_.append(self.obj1751)
        self.obj1751.graphObject_.pendingConnections.append(
            (self.obj1751.graphObject_.tag, self.obj1749.graphObject_.tag,
             [330.0, 111.0, 328.0, 77.0, 311.5, 63.25], 2, True))
        self.obj1752.out_connections_.append(self.obj1750)
        self.obj1750.in_connections_.append(self.obj1752)
        self.obj1752.graphObject_.pendingConnections.append(
            (self.obj1752.graphObject_.tag, self.obj1750.graphObject_.tag,
             [410.0, 271.0, 405.5, 250.5, 379.5, 235.25], 2, True))
        self.obj1753.out_connections_.append(self.obj1755)
        self.obj1755.in_connections_.append(self.obj1753)
        self.obj1753.graphObject_.pendingConnections.append(
            (self.obj1753.graphObject_.tag, self.obj1755.graphObject_.tag,
             [84.0, 181.0, 84.5, 131.5], 0, True))
        self.obj1754.out_connections_.append(self.obj1753)
        self.obj1753.in_connections_.append(self.obj1754)
        self.obj1754.graphObject_.pendingConnections.append(
            (self.obj1754.graphObject_.tag, self.obj1753.graphObject_.tag,
             [85.0, 82.0, 84.5, 131.5], 0, True))
        self.obj1754.out_connections_.append(self.obj1756)
        self.obj1756.in_connections_.append(self.obj1754)
        self.obj1754.graphObject_.pendingConnections.append(
            (self.obj1754.graphObject_.tag, self.obj1756.graphObject_.tag,
             [85.0, 82.0, 174.5, 69.0], 0, True))
        self.obj1754.out_connections_.append(self.obj1757)
        self.obj1757.in_connections_.append(self.obj1754)
        self.obj1754.graphObject_.pendingConnections.append(
            (self.obj1754.graphObject_.tag, self.obj1757.graphObject_.tag,
             [85.0, 82.0, 192.0, 90.0, 245.75, 97.25], 2, True))
        self.obj1755.out_connections_.append(self.obj1758)
        self.obj1758.in_connections_.append(self.obj1755)
        self.obj1755.graphObject_.pendingConnections.append(
            (self.obj1755.graphObject_.tag, self.obj1758.graphObject_.tag,
             [84.0, 226.0, 175.0, 234.0], 0, True))
        self.obj1756.out_connections_.append(self.obj1747)
        self.obj1747.in_connections_.append(self.obj1756)
        self.obj1756.graphObject_.pendingConnections.append(
            (self.obj1756.graphObject_.tag, self.obj1747.graphObject_.tag,
             [264.0, 56.0, 174.5, 69.0], 0, True))
        self.obj1757.out_connections_.append(self.obj1749)
        self.obj1749.in_connections_.append(self.obj1757)
        self.obj1757.graphObject_.pendingConnections.append(
            (self.obj1757.graphObject_.tag, self.obj1749.graphObject_.tag,
             [300.0, 111.0, 299.5, 104.5, 245.75, 97.25], 2, True))
        self.obj1758.out_connections_.append(self.obj1748)
        self.obj1748.in_connections_.append(self.obj1758)
        self.obj1758.graphObject_.pendingConnections.append(
            (self.obj1758.graphObject_.tag, self.obj1748.graphObject_.tag,
             [266.0, 242.0, 175.0, 234.0], 0, True))

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

        self.obj1762 = rawMaterial(parent)
        self.obj1762.preAction(self.RHS.CREATE)
        self.obj1762.isGraphObjectVisual = True

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

        # MaxFlow
        self.obj1762.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1762.ReqFlow.setNone()

        self.obj1762.GGLabel.setValue(6)
        self.obj1762.graphClass_ = graph_rawMaterial
        if parent.genGraphics:
            new_obj = graph_rawMaterial(240.0, 0.0, self.obj1762)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1762.graphObject_ = new_obj
        self.obj17620 = AttrCalc()
        self.obj17620.Copy = ATOM3Boolean()
        self.obj17620.Copy.setValue(('Copy from LHS', 1))
        self.obj17620.Copy.config = 0
        self.obj17620.Specify = ATOM3Constraint()
        self.obj17620.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.obj1762.GGset2Any['MaxFlow'] = self.obj17620
        self.obj17621 = AttrCalc()
        self.obj17621.Copy = ATOM3Boolean()
        self.obj17621.Copy.setValue(('Copy from LHS', 1))
        self.obj17621.Copy.config = 0
        self.obj17621.Specify = ATOM3Constraint()
        self.obj17621.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.obj1762.GGset2Any['Name'] = self.obj17621
        self.obj17622 = AttrCalc()
        self.obj17622.Copy = ATOM3Boolean()
        self.obj17622.Copy.setValue(('Copy from LHS', 1))
        self.obj17622.Copy.config = 0
        self.obj17622.Specify = ATOM3Constraint()
        self.obj17622.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.obj1762.GGset2Any['ReqFlow'] = self.obj17622

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

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

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

        # MaxFlow
        self.obj1763.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1763.ReqFlow.setNone()

        self.obj1763.GGLabel.setValue(11)
        self.obj1763.graphClass_ = graph_metarial
        if parent.genGraphics:
            new_obj = graph_metarial(260.0, 200.0, self.obj1763)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1763.graphObject_ = new_obj
        self.obj17630 = AttrCalc()
        self.obj17630.Copy = ATOM3Boolean()
        self.obj17630.Copy.setValue(('Copy from LHS', 1))
        self.obj17630.Copy.config = 0
        self.obj17630.Specify = ATOM3Constraint()
        self.obj17630.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.obj1763.GGset2Any['MaxFlow'] = self.obj17630
        self.obj17631 = AttrCalc()
        self.obj17631.Copy = ATOM3Boolean()
        self.obj17631.Copy.setValue(('Copy from LHS', 1))
        self.obj17631.Copy.config = 0
        self.obj17631.Specify = ATOM3Constraint()
        self.obj17631.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.obj1763.GGset2Any['Name'] = self.obj17631
        self.obj17632 = AttrCalc()
        self.obj17632.Copy = ATOM3Boolean()
        self.obj17632.Copy.setValue(('Copy from LHS', 1))
        self.obj17632.Copy.config = 0
        self.obj17632.Specify = ATOM3Constraint()
        self.obj17632.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.obj1763.GGset2Any['ReqFlow'] = self.obj17632

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

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

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

        # OperCostProp
        self.obj1764.OperCostProp.setNone()

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

        # OperCostFix
        self.obj1764.OperCostFix.setNone()

        self.obj1764.GGLabel.setValue(7)
        self.obj1764.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(280.0, 100.0, self.obj1764)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1764.graphObject_ = new_obj
        self.obj17640 = AttrCalc()
        self.obj17640.Copy = ATOM3Boolean()
        self.obj17640.Copy.setValue(('Copy from LHS', 1))
        self.obj17640.Copy.config = 0
        self.obj17640.Specify = ATOM3Constraint()
        self.obj17640.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.obj1764.GGset2Any['OperCostProp'] = self.obj17640
        self.obj17641 = AttrCalc()
        self.obj17641.Copy = ATOM3Boolean()
        self.obj17641.Copy.setValue(('Copy from LHS', 1))
        self.obj17641.Copy.config = 0
        self.obj17641.Specify = ATOM3Constraint()
        self.obj17641.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.obj1764.GGset2Any['name'] = self.obj17641
        self.obj17642 = AttrCalc()
        self.obj17642.Copy = ATOM3Boolean()
        self.obj17642.Copy.setValue(('Copy from LHS', 1))
        self.obj17642.Copy.config = 0
        self.obj17642.Specify = ATOM3Constraint()
        self.obj17642.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.obj1764.GGset2Any['OperCostFix'] = self.obj17642

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

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

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

        # OperCostProp
        self.obj1765.OperCostProp.setNone()

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

        # OperCostFix
        self.obj1765.OperCostFix.setNone()

        self.obj1765.GGLabel.setValue(12)
        self.obj1765.graphClass_ = graph_operatingUnit
        if parent.genGraphics:
            new_obj = graph_operatingUnit(360.0, 260.0, self.obj1765)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1765.graphObject_ = new_obj
        self.obj17650 = AttrCalc()
        self.obj17650.Copy = ATOM3Boolean()
        self.obj17650.Copy.setValue(('Copy from LHS', 1))
        self.obj17650.Copy.config = 0
        self.obj17650.Specify = ATOM3Constraint()
        self.obj17650.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.obj1765.GGset2Any['OperCostProp'] = self.obj17650
        self.obj17651 = AttrCalc()
        self.obj17651.Copy = ATOM3Boolean()
        self.obj17651.Copy.setValue(('Copy from LHS', 1))
        self.obj17651.Copy.config = 0
        self.obj17651.Specify = ATOM3Constraint()
        self.obj17651.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.obj1765.GGset2Any['name'] = self.obj17651
        self.obj17652 = AttrCalc()
        self.obj17652.Copy = ATOM3Boolean()
        self.obj17652.Copy.setValue(('Copy from LHS', 1))
        self.obj17652.Copy.config = 0
        self.obj17652.Specify = ATOM3Constraint()
        self.obj17652.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.obj1765.GGset2Any['OperCostFix'] = self.obj17652

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

        self.obj1766 = fromRaw(parent)
        self.obj1766.preAction(self.RHS.CREATE)
        self.obj1766.isGraphObjectVisual = True

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

        # rate
        self.obj1766.rate.setNone()

        self.obj1766.GGLabel.setValue(8)
        self.obj1766.graphClass_ = graph_fromRaw
        if parent.genGraphics:
            new_obj = graph_fromRaw(311.5, 63.25, self.obj1766)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1766.graphObject_ = new_obj
        self.obj17660 = AttrCalc()
        self.obj17660.Copy = ATOM3Boolean()
        self.obj17660.Copy.setValue(('Copy from LHS', 1))
        self.obj17660.Copy.config = 0
        self.obj17660.Specify = ATOM3Constraint()
        self.obj17660.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.obj1766.GGset2Any['rate'] = self.obj17660

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

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

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

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

        self.obj1767.GGLabel.setValue(17)
        self.obj1767.graphClass_ = graph_intoMaterial
        if parent.genGraphics:
            new_obj = graph_intoMaterial(324.25, 167.5, self.obj1767)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1767.graphObject_ = new_obj
        self.obj17670 = AttrCalc()
        self.obj17670.Copy = ATOM3Boolean()
        self.obj17670.Copy.setValue(('Copy from LHS', 0))
        self.obj17670.Copy.config = 0
        self.obj17670.Specify = ATOM3Constraint()
        self.obj17670.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]),
             'a = self.getMatched ( graphID , self.LHS.nodeWithLabel(1) ).name.getValue()\nb = self.getMatched ( graphID , self.LHS.nodeWithLabel(2) ).name.getValue()\nreturn self.graphRewritingSystem.Dictag[ a ][b]\n\n'
             ))
        self.obj1767.GGset2Any['rate'] = self.obj17670

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

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

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

        # rate
        self.obj1768.rate.setNone()

        self.obj1768.GGLabel.setValue(14)
        self.obj1768.graphClass_ = graph_fromMaterial
        if parent.genGraphics:
            new_obj = graph_fromMaterial(379.5, 235.25, self.obj1768)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1768.graphObject_ = new_obj
        self.obj17680 = AttrCalc()
        self.obj17680.Copy = ATOM3Boolean()
        self.obj17680.Copy.setValue(('Copy from LHS', 1))
        self.obj17680.Copy.config = 0
        self.obj17680.Specify = ATOM3Constraint()
        self.obj17680.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.obj1768.GGset2Any['rate'] = self.obj17680

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

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

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

        # rate
        self.obj1769.rate.setNone()

        self.obj1769.GGLabel.setValue(3)
        self.obj1769.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(84.5, 131.5, self.obj1769)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1769.graphObject_ = new_obj

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

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

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

        # price
        self.obj1770.price.setNone()

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

        self.obj1770.GGLabel.setValue(1)
        self.obj1770.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(60.0, 20.0, self.obj1770)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1770.graphObject_ = new_obj
        self.obj17700 = AttrCalc()
        self.obj17700.Copy = ATOM3Boolean()
        self.obj17700.Copy.setValue(('Copy from LHS', 1))
        self.obj17700.Copy.config = 0
        self.obj17700.Specify = ATOM3Constraint()
        self.obj17700.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.obj1770.GGset2Any['price'] = self.obj17700
        self.obj17701 = AttrCalc()
        self.obj17701.Copy = ATOM3Boolean()
        self.obj17701.Copy.setValue(('Copy from LHS', 1))
        self.obj17701.Copy.config = 0
        self.obj17701.Specify = ATOM3Constraint()
        self.obj17701.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.obj1770.GGset2Any['name'] = self.obj17701

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

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

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

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

        self.obj1771.GGLabel.setValue(2)
        self.obj1771.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(60.0, 180.0, self.obj1771)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1771.graphObject_ = new_obj
        self.obj17710 = AttrCalc()
        self.obj17710.Copy = ATOM3Boolean()
        self.obj17710.Copy.setValue(('Copy from LHS', 1))
        self.obj17710.Copy.config = 0
        self.obj17710.Specify = ATOM3Constraint()
        self.obj17710.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.obj1771.GGset2Any['name'] = self.obj17710

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

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

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

        self.obj1772.GGLabel.setValue(15)
        self.obj1772.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(174.5, 69.0, self.obj1772)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1772.graphObject_ = new_obj

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

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

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

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

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

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

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

        self.obj1774.GGLabel.setValue(13)
        self.obj1774.graphClass_ = graph_GenericGraphEdge
        if parent.genGraphics:
            new_obj = graph_GenericGraphEdge(175.0, 234.0, self.obj1774)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj1774.graphObject_ = new_obj

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

        self.obj1762.out_connections_.append(self.obj1766)
        self.obj1766.in_connections_.append(self.obj1762)
        self.obj1762.graphObject_.pendingConnections.append(
            (self.obj1762.graphObject_.tag, self.obj1766.graphObject_.tag,
             [264.0, 50.0, 311.5, 63.25], 2, 0))
        self.obj1763.out_connections_.append(self.obj1768)
        self.obj1768.in_connections_.append(self.obj1763)
        self.obj1763.graphObject_.pendingConnections.append(
            (self.obj1763.graphObject_.tag, self.obj1768.graphObject_.tag,
             [306.0, 210.0, 379.5, 235.25], 2, 0))
        self.obj1764.out_connections_.append(self.obj1767)
        self.obj1767.in_connections_.append(self.obj1764)
        self.obj1764.graphObject_.pendingConnections.append(
            (self.obj1764.graphObject_.tag, self.obj1767.graphObject_.tag,
             [333.0, 108.0, 331.0, 142.0, 324.25, 167.5], 2, True))
        self.obj1766.out_connections_.append(self.obj1764)
        self.obj1764.in_connections_.append(self.obj1766)
        self.obj1766.graphObject_.pendingConnections.append(
            (self.obj1766.graphObject_.tag, self.obj1764.graphObject_.tag,
             [330.0, 101.0, 311.5, 63.25], 2, 0))
        self.obj1767.out_connections_.append(self.obj1763)
        self.obj1763.in_connections_.append(self.obj1767)
        self.obj1767.graphObject_.pendingConnections.append(
            (self.obj1767.graphObject_.tag, self.obj1763.graphObject_.tag,
             [306.0, 210.0, 317.5, 193.0, 324.25, 167.5], 2, True))
        self.obj1768.out_connections_.append(self.obj1765)
        self.obj1765.in_connections_.append(self.obj1768)
        self.obj1768.graphObject_.pendingConnections.append(
            (self.obj1768.graphObject_.tag, self.obj1765.graphObject_.tag,
             [413.0, 268.0, 379.5, 235.25], 2, 0))
        self.obj1769.out_connections_.append(self.obj1771)
        self.obj1771.in_connections_.append(self.obj1769)
        self.obj1769.graphObject_.pendingConnections.append(
            (self.obj1769.graphObject_.tag, self.obj1771.graphObject_.tag,
             [91.0, 180.0, 84.5, 131.5], 2, 0))
        self.obj1770.out_connections_.append(self.obj1769)
        self.obj1769.in_connections_.append(self.obj1770)
        self.obj1770.graphObject_.pendingConnections.append(
            (self.obj1770.graphObject_.tag, self.obj1769.graphObject_.tag,
             [97.0, 82.0, 84.5, 131.5], 2, 0))
        self.obj1770.out_connections_.append(self.obj1772)
        self.obj1772.in_connections_.append(self.obj1770)
        self.obj1770.graphObject_.pendingConnections.append(
            (self.obj1770.graphObject_.tag, self.obj1772.graphObject_.tag,
             [97.0, 82.0, 174.5, 69.0], 2, 0))
        self.obj1770.out_connections_.append(self.obj1773)
        self.obj1773.in_connections_.append(self.obj1770)
        self.obj1770.graphObject_.pendingConnections.append(
            (self.obj1770.graphObject_.tag, self.obj1773.graphObject_.tag,
             [97.0, 82.0, 245.75, 97.25], 2, 0))
        self.obj1771.out_connections_.append(self.obj1774)
        self.obj1774.in_connections_.append(self.obj1771)
        self.obj1771.graphObject_.pendingConnections.append(
            (self.obj1771.graphObject_.tag, self.obj1774.graphObject_.tag,
             [91.0, 225.0, 175.0, 234.0], 2, 0))
        self.obj1772.out_connections_.append(self.obj1762)
        self.obj1762.in_connections_.append(self.obj1772)
        self.obj1772.graphObject_.pendingConnections.append(
            (self.obj1772.graphObject_.tag, self.obj1762.graphObject_.tag,
             [264.0, 50.0, 174.5, 69.0], 2, 0))
        self.obj1773.out_connections_.append(self.obj1764)
        self.obj1764.in_connections_.append(self.obj1773)
        self.obj1773.graphObject_.pendingConnections.append(
            (self.obj1773.graphObject_.tag, self.obj1764.graphObject_.tag,
             [300.0, 101.0, 245.75, 97.25], 2, 0))
        self.obj1774.out_connections_.append(self.obj1763)
        self.obj1763.in_connections_.append(self.obj1774)
        self.obj1774.graphObject_.pendingConnections.append(
            (self.obj1774.graphObject_.tag, self.obj1763.graphObject_.tag,
             [266.0, 242.0, 175.0, 234.0], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        print 'Rule 21 '
        node7 = self.getMatched(graphID, self.LHS.nodeWithLabel(7))

        node11 = self.getMatched(graphID, self.LHS.nodeWithLabel(11))
        node1 = self.getMatched(graphID, self.LHS.nodeWithLabel(1))

        print node7.name.getValue() + ' in ' + node11.Name.getValue()
        print node7.name.getValue() in node11.Name.getValue()

        test = not (hasattr(node11, "linkAux2") and hasattr(node7, "linkAux2"))
        print test
        if test:
            return (node7.name.getValue() in node11.Name.getValue())
        else:
            return False

    def action(self, graphID, isograph, atom3i):
        # code action of rule
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(7))
        node.linkAux2 = True
        node = self.getMatched(graphID, self.LHS.nodeWithLabel(11))
        node.linkAux2 = True
        self.graphRewritingSystem.finalStat = 21
Exemplo n.º 11
0
class Agent2RoleLink_GG_rule(GGrule):
    def __init__(self, parent):
        GGrule.__init__(self, 1)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_omacs(parent)

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

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

        # price
        self.obj128.price.setNone()

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

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

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

        self.obj129 = Capabilitie(parent)
        self.obj129.preAction(self.LHS.CREATE)
        self.obj129.isGraphObjectVisual = True

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

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

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

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

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

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

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

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

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

        self.obj131 = posses(parent)
        self.obj131.preAction(self.LHS.CREATE)
        self.obj131.isGraphObjectVisual = True

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

        # rate
        self.obj131.rate.setNone()

        self.obj131.GGLabel.setValue(4)
        self.obj131.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(143.0, 130.5, self.obj131)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj131.graphObject_ = new_obj

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

        self.obj134 = require(parent)
        self.obj134.preAction(self.LHS.CREATE)
        self.obj134.isGraphObjectVisual = True

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

        self.obj134.GGLabel.setValue(5)
        self.obj134.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(242.5, 132.5, self.obj134)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj134.graphObject_ = new_obj

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

        self.obj128.out_connections_.append(self.obj131)
        self.obj131.in_connections_.append(self.obj128)
        self.obj128.graphObject_.pendingConnections.append(
            (self.obj128.graphObject_.tag, self.obj131.graphObject_.tag,
             [105.0, 82.0, 143.0, 130.5], 0, True))
        self.obj130.out_connections_.append(self.obj134)
        self.obj134.in_connections_.append(self.obj130)
        self.obj130.graphObject_.pendingConnections.append(
            (self.obj130.graphObject_.tag, self.obj134.graphObject_.tag,
             [304.0, 86.0, 242.5, 132.5], 0, True))
        self.obj131.out_connections_.append(self.obj129)
        self.obj129.in_connections_.append(self.obj131)
        self.obj131.graphObject_.pendingConnections.append(
            (self.obj131.graphObject_.tag, self.obj129.graphObject_.tag,
             [181.0, 179.0, 143.0, 130.5], 0, True))
        self.obj134.out_connections_.append(self.obj129)
        self.obj129.in_connections_.append(self.obj134)
        self.obj134.graphObject_.pendingConnections.append(
            (self.obj134.graphObject_.tag, self.obj129.graphObject_.tag,
             [181.0, 179.0, 242.5, 132.5], 0, True))

        self.RHS = ASG_omacs(parent)

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

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

        # price
        self.obj128.price.setNone()

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

        self.obj128.GGLabel.setValue(1)
        self.obj128.graphClass_ = graph_Agent
        if parent.genGraphics:
            new_obj = graph_Agent(80.0, 20.0, self.obj128)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj128.graphObject_ = new_obj
        self.obj1280 = AttrCalc()
        self.obj1280.Copy = ATOM3Boolean()
        self.obj1280.Copy.setValue(('Copy from LHS', 1))
        self.obj1280.Copy.config = 0
        self.obj1280.Specify = ATOM3Constraint()
        self.obj1280.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.obj128.GGset2Any['price'] = self.obj1280
        self.obj1281 = AttrCalc()
        self.obj1281.Copy = ATOM3Boolean()
        self.obj1281.Copy.setValue(('Copy from LHS', 1))
        self.obj1281.Copy.config = 0
        self.obj1281.Specify = ATOM3Constraint()
        self.obj1281.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.obj128.GGset2Any['name'] = self.obj1281

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

        self.obj129 = Capabilitie(parent)
        self.obj129.preAction(self.RHS.CREATE)
        self.obj129.isGraphObjectVisual = True

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

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

        self.obj129.GGLabel.setValue(2)
        self.obj129.graphClass_ = graph_Capabilitie
        if parent.genGraphics:
            new_obj = graph_Capabilitie(160.0, 180.0, self.obj129)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj129.graphObject_ = new_obj
        self.obj1290 = AttrCalc()
        self.obj1290.Copy = ATOM3Boolean()
        self.obj1290.Copy.setValue(('Copy from LHS', 1))
        self.obj1290.Copy.config = 0
        self.obj1290.Specify = ATOM3Constraint()
        self.obj1290.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.obj129.GGset2Any['name'] = self.obj1290

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

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

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

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

        self.obj130.GGLabel.setValue(3)
        self.obj130.graphClass_ = graph_Role
        if parent.genGraphics:
            new_obj = graph_Role(280.0, 40.0, self.obj130)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj130.graphObject_ = new_obj
        self.obj1300 = AttrCalc()
        self.obj1300.Copy = ATOM3Boolean()
        self.obj1300.Copy.setValue(('Copy from LHS', 1))
        self.obj1300.Copy.config = 0
        self.obj1300.Specify = ATOM3Constraint()
        self.obj1300.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.obj130.GGset2Any['name'] = self.obj1300

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

        self.obj131 = posses(parent)
        self.obj131.preAction(self.RHS.CREATE)
        self.obj131.isGraphObjectVisual = True

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

        # rate
        self.obj131.rate.setNone()

        self.obj131.GGLabel.setValue(4)
        self.obj131.graphClass_ = graph_posses
        if parent.genGraphics:
            new_obj = graph_posses(143.0, 130.5, self.obj131)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj131.graphObject_ = new_obj
        self.obj1310 = AttrCalc()
        self.obj1310.Copy = ATOM3Boolean()
        self.obj1310.Copy.setValue(('Copy from LHS', 1))
        self.obj1310.Copy.config = 0
        self.obj1310.Specify = ATOM3Constraint()
        self.obj1310.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.obj131.GGset2Any['rate'] = self.obj1310

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

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

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

        self.obj148.GGLabel.setValue(7)
        self.obj148.graphClass_ = graph_CapableOf
        if parent.genGraphics:
            new_obj = graph_CapableOf(214.0, 83.5, self.obj148)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj148.graphObject_ = new_obj

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

        self.obj134 = require(parent)
        self.obj134.preAction(self.RHS.CREATE)
        self.obj134.isGraphObjectVisual = True

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

        self.obj134.GGLabel.setValue(5)
        self.obj134.graphClass_ = graph_require
        if parent.genGraphics:
            new_obj = graph_require(242.5, 132.5, self.obj134)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
        else:
            new_obj = None
        self.obj134.graphObject_ = new_obj

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

        self.obj128.out_connections_.append(self.obj131)
        self.obj131.in_connections_.append(self.obj128)
        self.obj128.graphObject_.pendingConnections.append(
            (self.obj128.graphObject_.tag, self.obj131.graphObject_.tag,
             [117.0, 82.0, 143.0, 130.5], 2, 0))
        self.obj128.out_connections_.append(self.obj148)
        self.obj148.in_connections_.append(self.obj128)
        self.obj128.graphObject_.pendingConnections.append(
            (self.obj128.graphObject_.tag, self.obj148.graphObject_.tag,
             [117.0, 82.0, 214.0, 83.5], 0, True))
        self.obj130.out_connections_.append(self.obj134)
        self.obj134.in_connections_.append(self.obj130)
        self.obj130.graphObject_.pendingConnections.append(
            (self.obj130.graphObject_.tag, self.obj134.graphObject_.tag,
             [311.0, 85.0, 242.5, 132.5], 2, 0))
        self.obj131.out_connections_.append(self.obj129)
        self.obj129.in_connections_.append(self.obj131)
        self.obj131.graphObject_.pendingConnections.append(
            (self.obj131.graphObject_.tag, self.obj129.graphObject_.tag,
             [191.0, 183.0, 143.0, 130.5], 2, 0))
        self.obj148.out_connections_.append(self.obj130)
        self.obj130.in_connections_.append(self.obj148)
        self.obj148.graphObject_.pendingConnections.append(
            (self.obj148.graphObject_.tag, self.obj130.graphObject_.tag,
             [311.0, 85.0, 214.0, 83.5], 0, True))
        self.obj134.out_connections_.append(self.obj129)
        self.obj129.in_connections_.append(self.obj134)
        self.obj134.graphObject_.pendingConnections.append(
            (self.obj134.graphObject_.tag, self.obj129.graphObject_.tag,
             [191.0, 183.0, 242.5, 132.5], 2, 0))

    def condition(self, graphID, isograph, atom3i):
        agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))

        role = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        return not (hasattr(agent, role.name.getValue())
                    and hasattr(role, agent.name.getValue()))

    def action(self, graphID, isograph, atom3i):
        agent = self.getMatched(graphID, self.LHS.nodeWithLabel(1))

        c1 = self.getMatched(graphID, self.LHS.nodeWithLabel(2))
        role = self.getMatched(graphID, self.LHS.nodeWithLabel(3))
        setattr(agent, role.name.getValue(), True)
        setattr(role, agent.name.getValue(), True)

        setattr(c1, agent.name.getValue(), True)
        setattr(c1, role.name.getValue(), True)

        print 'connCt (' + agent.name.getValue() + ',' + role.name.getValue(
        ) + ')'