コード例 #1
0
def test():
    """Tests the product function in the product class
	Write here all test you want to do.
	REMEMBER to test your programm you can't use __init__ function
	"""
    assert product.check_PC("localhost",
                            1) == True, "Checker PC fails (personal_code: 1)"
    assert product.check_PC("localhost",
                            2) == True, "Checker PC fails (personal_code: 1)"
    assert product.check_PC("localhost",
                            10) == True, "Checker PC fails (personal_code: 1)"

    assert product.make_csv_standard(
        "'test','test'\n'example value','example value 2'\n'example value','example value 2'\n'example value','example value 2'"
    ) == "'test','test'\n'example value','example value 2'\n'example value','example value 2'\n'example value','example value 2'", "Maker CSV standard fails (personal_code: 2)"

    assert product.csv2array(
        "'test','test'\n'example value','example value 2'\n'example value','example value 2'\n'example value','example value 2'"
    ) == [["'test'", "'test'"], ["'example value'", "'example value 2'"],
          ["'example value'", "'example value 2'"],
          ["'example value'",
           "'example value 2'"]], "CSV2Array fails (personal_code: 3a)"

    assert product.array2csv(
        [["test", "test"], ["example value", "example value 2"],
         ["example value", "example value 2"],
         ["example value", "example value 2"]]
    ) == '"test","test"\n"example value","example value 2"\n"example value","example value 2"\n"example value","example value 2"\n', "Array2CSV fails (personal_code: 3b)"

    assert product(), "test failed (personal_code: 0)"  # check all code
コード例 #2
0
ファイル: homemng.py プロジェクト: dfdevs/testpy
 def handle_send_button(self):
     prod = product()
     prod.prodInsert(
         self.inpName, self.inpType, self.inpBrand, self.inpFormat, self.inpStock, self.inpMstock, self.inpRate
     )
     self.del_widgets()
     self.addProduct()
コード例 #3
0
def decrypt(prefix):
    res = []
    for suffix in product(letters, repeat=5 - len(prefix)):
        passwd = np.concatenate([prefix, suffix])
        text = decode(ciphertext, passwd)
        if isgood(text):
            passwd = "".join(map(chr, passwd))
            res.append((passwd, text))
    return res
コード例 #4
0
ファイル: market_parse.py プロジェクト: winch/Work-projects
 def startElement(self, name, attr):
     if name == "Family":
         self.family = family()
         self.family.name = attr.getValue("Name")
     if name == "Product":
         attributes = attr.getNames()
         prod = product()
         prod.name = attr.getValue("Name")
         if "DisplayMode" in attributes:
             prod.displayMode = attr.getValue("DisplayMode")
         else:
             prod.displayMode = "Visible"
         self.family.products.append(prod)
コード例 #5
0
def ajouter(produts):
    print(colored("\n\n\nVous etes entrain d'ajouter un produit",color="blue"))
    try:
        nom = str(input(colored("\nEntrer le nom du produit : ",color="yellow")))
        prix = int(input(colored("\nS'il vous plait son prix : ",color="yellow")))
        description = str(
            input(colored("\nEt enfin sa description : ",color="yellow")))
    except ValueError:
        print(colored("\nEntrer un bonne element",color="red"))
        ajouter(produts)
    produts.append(product(nom, prix, description))
    repeat(
        "\nAimeriez vous ajouter un produit [Oui | Non => autres] ? ", ajouter, produts)
コード例 #6
0
ファイル: pns2_MM.py プロジェクト: elkhayer/Formalism
def createNewproduct(self, wherex, wherey, screenCoordinates=1):
    self.fromClass = None
    self.toClass = None
    # try the global constraints...
    res = self.ASGroot.preCondition(ASG.CREATE)
    if res:
        self.constraintViolation(res)
        self.mode = self.IDLEMODE
        return

    new_semantic_obj = product(self)
    res = new_semantic_obj.preCondition(ASGNode.CREATE)
    if res: return self.constraintViolation(res)
    new_semantic_obj.preAction(ASGNode.CREATE)

    ne = len(self.ASGroot.listNodes["product"])
    if new_semantic_obj.keyword_:
        new_semantic_obj.keyword_.setValue(
            new_semantic_obj.keyword_.toString() + str(ne))
    if screenCoordinates:
        new_obj = graph_product(self.UMLmodel.canvasx(wherex),
                                self.UMLmodel.canvasy(wherey),
                                new_semantic_obj)
    else:  # already in canvas coordinates
        new_obj = graph_product(wherex, wherey, new_semantic_obj)
    new_obj.DrawObject(self.UMLmodel, self.editGGLabel)
    self.UMLmodel.addtag_withtag("product", new_obj.tag)
    new_semantic_obj.graphObject_ = new_obj
    self.ASGroot.addNode(new_semantic_obj)
    res = self.ASGroot.postCondition(ASG.CREATE)
    if res:
        self.constraintViolation(res)
        self.mode = self.IDLEMODE
        return

    res = new_semantic_obj.postCondition(ASGNode.CREATE)
    if res:
        self.constraintViolation(res)
        self.mode = self.IDLEMODE
        return
    new_semantic_obj.postAction(ASGNode.CREATE)

    self.mode = self.IDLEMODE
    if self.editGGLabel:
        self.statusbar.event(StatusBar.TRANSFORMATION, StatusBar.CREATE)
    else:
        self.statusbar.event(StatusBar.MODEL, StatusBar.CREATE)
    return new_semantic_obj
コード例 #7
0
session.set_keyspace('adv')
rows2 = session.execute('
select t.range, count(*) as num
from
   (select case
       when price_product < 50 then '0 - 50'
       when price_product >= 50 and price_product < 500 then '50 - 500'
       when price_product >= 500  then 'more 500'
       end
       as range,
       price_product
       from product)
	   as t
group by range
')
INSERT INTO product (name_adv, name_product)
VALUES (123, 22, "USA")
CONSISTENCY [ TWO ]
session.set_keyspace('product')
rows3 = session.execute('
SELECT DISTINCT name_product, id_product, name_provider, name_adv, price_product, count_product, factory 
FROM product, provider 
WHERE name_product_p.product = name_product.provider, name_provider.product=name_provider_p.provider;

')
INSERT INTO provider (name_product, id_product, name_provider, name_adv, price_product, count_product, factory )
VALUES ('laundry soap', 221, 'PandG', 'laundry soap adv', 99, 23, ['Kyiv factory', 'Kharkiv factory' ])
CONSISTENCY [ THREE ]

session.set_keyspace('provider')
rows4 = session.execute('
コード例 #8
0
 42: assert is_consonant('a') == False
 43: assert is_consonant('c') == True
 44: 
 45: from function_exercises import is_consonant as is_this_a_consonant
 46: 
 47: assert is_this_a_consonant('a') == False
 48: assert is_this_a_consonant('c') == True
 49: 
 50: # 2. For the following exercises, read about and use the itertools module from the standard library to help you solve the problem.
 51: 
 52: # How many different ways can you combine the letters from "abc" with the numbers 1, 2, and 3?
 53: # How many different ways can you combine two of the letters from "abcd"?
 54: 
 55: from itertools import product
 56: 
 57: product_list = list(product('abd', [1,2,3]))
 58: product_count = len(product_list)
 59: print(product_count)
 60: 
 61: from itertools import combinations_with_replacement
 62: 
 63: combo_list = list(combinations_with_replacement('abcd', 2))
 64: combo_count = len(combo_list)
 65: print(combo_count)
 66: 
 67: from itertools import combinations
 68: 
 69: combonation_list = list(combinations('abcd', 2))
 70: combonation_count = len(combonation_list)
 71: print(combo_count)
 72: 
コード例 #9
0
ファイル: homemng.py プロジェクト: dfdevs/testpy
 def handle_update_prod(self):
     prod = product()
     prod.prodUpdate(self.pname, self.entrline.get())
コード例 #10
0
    def __init__(self, parent):
        GGrule.__init__(self, 13)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)

        self.RHS = ASG_pns(parent)

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

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

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

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

        # Name
        self.obj1670.Name.setValue('OAF')

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

        self.obj1670.GGLabel.setValue(1)
        self.obj1670.graphClass_ = graph_product
        if parent.genGraphics:
            new_obj = graph_product(100.0, 80.0, self.obj1670)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj1670.graphObject_ = new_obj
        self.obj16700 = AttrCalc()
        self.obj16700.Copy = ATOM3Boolean()
        self.obj16700.Copy.setValue(('Copy from LHS', 1))
        self.obj16700.Copy.config = 0
        self.obj16700.Specify = ATOM3Constraint()
        self.obj16700.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.obj1670.GGset2Any['MaxFlow'] = self.obj16700
        self.obj16701 = AttrCalc()
        self.obj16701.Copy = ATOM3Boolean()
        self.obj16701.Copy.setValue(('Copy from LHS', 0))
        self.obj16701.Copy.config = 0
        self.obj16701.Specify = ATOM3Constraint()
        self.obj16701.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.obj1670.GGset2Any['Name'] = self.obj16701
        self.obj16702 = AttrCalc()
        self.obj16702.Copy = ATOM3Boolean()
        self.obj16702.Copy.setValue(('Copy from LHS', 1))
        self.obj16702.Copy.config = 0
        self.obj16702.Specify = ATOM3Constraint()
        self.obj16702.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.obj1670.GGset2Any['ReqFlow'] = self.obj16702

        # Add node to the root: self.RHS
        self.RHS.addNode(self.obj1670)
        self.obj1670.postAction(self.RHS.CREATE)
コード例 #11
0
    def __init__(self, parent):
        GGrule.__init__(self, 15)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)
        self.LHS.merge(ASG_omacs(parent))
        self.LHS.merge(ASG_GenericGraph(parent))

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

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

        # MaxFlow
        self.obj1677.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1677.ReqFlow.setNone()

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

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

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

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

        # MaxFlow
        self.obj1678.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1678.ReqFlow.setNone()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        # MaxFlow
        self.obj1684.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1684.ReqFlow.setNone()

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

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

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

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

        # MaxFlow
        self.obj1685.MaxFlow.setNone()

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

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

        # ReqFlow
        self.obj1685.ReqFlow.setNone()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        self.obj1685.out_connections_.append(self.obj1688)
        self.obj1688.in_connections_.append(self.obj1685)
        self.obj1685.graphObject_.pendingConnections.append(
            (self.obj1685.graphObject_.tag, self.obj1688.graphObject_.tag,
             [244.0, 89.0, 342.0, 110.0], 0, True))
        self.obj1686.out_connections_.append(self.obj1687)
        self.obj1687.in_connections_.append(self.obj1686)
        self.obj1686.graphObject_.pendingConnections.append(
            (self.obj1686.graphObject_.tag, self.obj1687.graphObject_.tag,
             [339.0, 158.0, 322.0, 179.0], 0, True))
        self.obj1687.out_connections_.append(self.obj1684)
        self.obj1684.in_connections_.append(self.obj1687)
        self.obj1687.graphObject_.pendingConnections.append(
            (self.obj1687.graphObject_.tag, self.obj1684.graphObject_.tag,
             [305.0, 220.0, 322.0, 179.0], 0, True))
        self.obj1688.out_connections_.append(self.obj1686)
        self.obj1686.in_connections_.append(self.obj1688)
        self.obj1688.graphObject_.pendingConnections.append(
            (self.obj1688.graphObject_.tag, self.obj1686.graphObject_.tag,
             [340.0, 151.0, 342.0, 110.0], 0, True))
        self.obj1689.out_connections_.append(self.obj1690)
        self.obj1690.in_connections_.append(self.obj1689)
        self.obj1689.graphObject_.pendingConnections.append(
            (self.obj1689.graphObject_.tag, self.obj1690.graphObject_.tag,
             [93.0, 61.0, 264.5, 71.5], 2, 0))
        self.obj1690.out_connections_.append(self.obj1685)
        self.obj1685.in_connections_.append(self.obj1690)
        self.obj1690.graphObject_.pendingConnections.append(
            (self.obj1690.graphObject_.tag, self.obj1685.graphObject_.tag,
             [226.0, 82.0, 264.5, 71.5], 2, 0))
コード例 #12
0
def pnsEx2_MDL(self, rootNode, pnsRootNode=None):

    # --- Generating attributes code for ASG pns ---
    if (pnsRootNode):
        # author
        pnsRootNode.author.setValue('Annonymous')

        # description
        pnsRootNode.description.setValue('\n')
        pnsRootNode.description.setHeight(15)

        # name
        pnsRootNode.name.setValue('')
        pnsRootNode.name.setNone()
    # --- ASG attributes over ---

    self.obj2050 = rawMaterial(self)
    self.obj2050.isGraphObjectVisual = True

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

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

    # price
    self.obj2050.price.setValue(5)

    # Name
    self.obj2050.Name.setValue('A1')

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

    self.obj2050.graphClass_ = graph_rawMaterial
    if self.genGraphics:
        new_obj = graph_rawMaterial(412, 0, self.obj2050)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("rawMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2050.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2050)
    self.globalAndLocalPostcondition(self.obj2050, rootNode)
    self.obj2050.postAction(rootNode.CREATE)

    self.obj2051 = rawMaterial(self)
    self.obj2051.isGraphObjectVisual = True

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

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

    # price
    self.obj2051.price.setValue(5)

    # Name
    self.obj2051.Name.setValue('A2')

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

    self.obj2051.graphClass_ = graph_rawMaterial
    if self.genGraphics:
        new_obj = graph_rawMaterial(0, 0, self.obj2051)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("rawMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2051.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2051)
    self.globalAndLocalPostcondition(self.obj2051, rootNode)
    self.obj2051.postAction(rootNode.CREATE)

    self.obj2052 = operatingUnit(self)
    self.obj2052.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj2052.OperCostProp.setValue(0.5)

    # name
    self.obj2052.name.setValue('A1 R1')

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

    self.obj2052.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(412, 108, self.obj2052)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2052.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2052)
    self.globalAndLocalPostcondition(self.obj2052, rootNode)
    self.obj2052.postAction(rootNode.CREATE)

    self.obj2053 = operatingUnit(self)
    self.obj2053.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj2053.OperCostProp.setValue(0.25)

    # name
    self.obj2053.name.setValue('A2 R2')

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

    self.obj2053.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(0, 108, self.obj2053)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2053.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2053)
    self.globalAndLocalPostcondition(self.obj2053, rootNode)
    self.obj2053.postAction(rootNode.CREATE)

    self.obj2054 = operatingUnit(self)
    self.obj2054.isGraphObjectVisual = True

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

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

    # name
    self.obj2054.name.setValue('G1 OAF')

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

    self.obj2054.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(412, 450, self.obj2054)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2054.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2054)
    self.globalAndLocalPostcondition(self.obj2054, rootNode)
    self.obj2054.postAction(rootNode.CREATE)

    self.obj2055 = operatingUnit(self)
    self.obj2055.isGraphObjectVisual = True

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

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

    # name
    self.obj2055.name.setValue('G2 OAF')

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

    self.obj2055.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(206, 450, self.obj2055)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2055.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2055)
    self.globalAndLocalPostcondition(self.obj2055, rootNode)
    self.obj2055.postAction(rootNode.CREATE)

    self.obj2056 = operatingUnit(self)
    self.obj2056.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj2056.OperCostProp.setValue(0.11)

    # name
    self.obj2056.name.setValue('A1 R1 G1')

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

    self.obj2056.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(412, 279, self.obj2056)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2056.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2056)
    self.globalAndLocalPostcondition(self.obj2056, rootNode)
    self.obj2056.postAction(rootNode.CREATE)

    self.obj2057 = operatingUnit(self)
    self.obj2057.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj2057.OperCostProp.setValue(0.12)

    # name
    self.obj2057.name.setValue('A1 R1 G2')

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

    self.obj2057.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(206, 279, self.obj2057)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2057.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2057)
    self.globalAndLocalPostcondition(self.obj2057, rootNode)
    self.obj2057.postAction(rootNode.CREATE)

    self.obj2058 = operatingUnit(self)
    self.obj2058.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj2058.OperCostProp.setValue(0.22)

    # name
    self.obj2058.name.setValue('A2 R2 G2')

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

    self.obj2058.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(0, 279, self.obj2058)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2058.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2058)
    self.globalAndLocalPostcondition(self.obj2058, rootNode)
    self.obj2058.postAction(rootNode.CREATE)

    self.obj2059 = metarial(self)
    self.obj2059.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj2059.Name.setValue('G1')

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

    self.obj2059.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(412, 350, self.obj2059)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2059.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2059)
    self.globalAndLocalPostcondition(self.obj2059, rootNode)
    self.obj2059.postAction(rootNode.CREATE)

    self.obj2060 = metarial(self)
    self.obj2060.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj2060.Name.setValue('G2')

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

    self.obj2060.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(206, 350, self.obj2060)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2060.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2060)
    self.globalAndLocalPostcondition(self.obj2060, rootNode)
    self.obj2060.postAction(rootNode.CREATE)

    self.obj2061 = metarial(self)
    self.obj2061.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj2061.Name.setValue('A1 R1 G1')

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

    self.obj2061.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(412, 179, self.obj2061)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2061.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2061)
    self.globalAndLocalPostcondition(self.obj2061, rootNode)
    self.obj2061.postAction(rootNode.CREATE)

    self.obj2062 = metarial(self)
    self.obj2062.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj2062.Name.setValue('A1 R1 G2')

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

    self.obj2062.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(206, 179, self.obj2062)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2062.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2062)
    self.globalAndLocalPostcondition(self.obj2062, rootNode)
    self.obj2062.postAction(rootNode.CREATE)

    self.obj2063 = metarial(self)
    self.obj2063.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj2063.Name.setValue('A2 R2 G2')

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

    self.obj2063.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(0, 179, self.obj2063)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2063.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2063)
    self.globalAndLocalPostcondition(self.obj2063, rootNode)
    self.obj2063.postAction(rootNode.CREATE)

    self.obj2064 = product(self)
    self.obj2064.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj2064.Name.setValue('OAF')

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

    self.obj2064.graphClass_ = graph_product
    if self.genGraphics:
        new_obj = graph_product(412, 521, self.obj2064)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("product", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2064.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2064)
    self.globalAndLocalPostcondition(self.obj2064, rootNode)
    self.obj2064.postAction(rootNode.CREATE)

    self.obj2065 = fromMaterial(self)
    self.obj2065.isGraphObjectVisual = True

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

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

    self.obj2065.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(443.97925309, 430.64382278, self.obj2065)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2065.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2065)
    self.globalAndLocalPostcondition(self.obj2065, rootNode)
    self.obj2065.postAction(rootNode.CREATE)

    self.obj2066 = fromMaterial(self)
    self.obj2066.isGraphObjectVisual = True

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

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

    self.obj2066.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(237.97925309, 430.64382278, self.obj2066)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2066.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2066)
    self.globalAndLocalPostcondition(self.obj2066, rootNode)
    self.obj2066.postAction(rootNode.CREATE)

    self.obj2067 = fromMaterial(self)
    self.obj2067.isGraphObjectVisual = True

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

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

    self.obj2067.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(463.682773237, 256.50121981, self.obj2067)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2067.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2067)
    self.globalAndLocalPostcondition(self.obj2067, rootNode)
    self.obj2067.postAction(rootNode.CREATE)

    self.obj2068 = fromMaterial(self)
    self.obj2068.isGraphObjectVisual = True

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

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

    self.obj2068.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(257.682773237, 256.50121981, self.obj2068)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2068.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2068)
    self.globalAndLocalPostcondition(self.obj2068, rootNode)
    self.obj2068.postAction(rootNode.CREATE)

    self.obj2069 = fromMaterial(self)
    self.obj2069.isGraphObjectVisual = True

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

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

    self.obj2069.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(51.6827732371, 256.50121981, self.obj2069)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2069.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2069)
    self.globalAndLocalPostcondition(self.obj2069, rootNode)
    self.obj2069.postAction(rootNode.CREATE)

    self.obj2070 = intoProduct(self)
    self.obj2070.isGraphObjectVisual = True

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

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

    self.obj2070.graphClass_ = graph_intoProduct
    if self.genGraphics:
        new_obj = graph_intoProduct(443.936529683, 493.375109847, self.obj2070)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoProduct", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2070.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2070)
    self.globalAndLocalPostcondition(self.obj2070, rootNode)
    self.obj2070.postAction(rootNode.CREATE)

    self.obj2071 = intoProduct(self)
    self.obj2071.isGraphObjectVisual = True

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

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

    self.obj2071.graphClass_ = graph_intoProduct
    if self.genGraphics:
        new_obj = graph_intoProduct(350.853713603, 484.915829787, self.obj2071)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoProduct", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2071.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2071)
    self.globalAndLocalPostcondition(self.obj2071, rootNode)
    self.obj2071.postAction(rootNode.CREATE)

    self.obj2072 = fromRaw(self)
    self.obj2072.isGraphObjectVisual = True

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

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

    self.obj2072.graphClass_ = graph_fromRaw
    if self.genGraphics:
        new_obj = graph_fromRaw(443.979904526, 88.1336447318, self.obj2072)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromRaw", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2072.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2072)
    self.globalAndLocalPostcondition(self.obj2072, rootNode)
    self.obj2072.postAction(rootNode.CREATE)

    self.obj2073 = fromRaw(self)
    self.obj2073.isGraphObjectVisual = True

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

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

    self.obj2073.graphClass_ = graph_fromRaw
    if self.genGraphics:
        new_obj = graph_fromRaw(31.9799045263, 88.1336447318, self.obj2073)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromRaw", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2073.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2073)
    self.globalAndLocalPostcondition(self.obj2073, rootNode)
    self.obj2073.postAction(rootNode.CREATE)

    self.obj2074 = intoMaterial(self)
    self.obj2074.isGraphObjectVisual = True

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

    # rate
    self.obj2074.rate.setValue(0.11)

    self.obj2074.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(444.407115796, 321.140199793,
                                     self.obj2074)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2074.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2074)
    self.globalAndLocalPostcondition(self.obj2074, rootNode)
    self.obj2074.postAction(rootNode.CREATE)

    self.obj2075 = intoMaterial(self)
    self.obj2075.isGraphObjectVisual = True

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

    # rate
    self.obj2075.rate.setValue(0.12)

    self.obj2075.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(238.407115796, 321.140199793,
                                     self.obj2075)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2075.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2075)
    self.globalAndLocalPostcondition(self.obj2075, rootNode)
    self.obj2075.postAction(rootNode.CREATE)

    self.obj2076 = intoMaterial(self)
    self.obj2076.isGraphObjectVisual = True

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

    # rate
    self.obj2076.rate.setValue(0.22)

    self.obj2076.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(137.852377142, 316.57866424, self.obj2076)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2076.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2076)
    self.globalAndLocalPostcondition(self.obj2076, rootNode)
    self.obj2076.postAction(rootNode.CREATE)

    self.obj2077 = intoMaterial(self)
    self.obj2077.isGraphObjectVisual = True

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

    # rate
    self.obj2077.rate.setValue(0.5)

    self.obj2077.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(448.986832981, 148.33772234, self.obj2077)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2077.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2077)
    self.globalAndLocalPostcondition(self.obj2077, rootNode)
    self.obj2077.postAction(rootNode.CREATE)

    self.obj2078 = intoMaterial(self)
    self.obj2078.isGraphObjectVisual = True

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

    # rate
    self.obj2078.rate.setValue(0.5)

    self.obj2078.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(349.992999454, 166.870109648,
                                     self.obj2078)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2078.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2078)
    self.globalAndLocalPostcondition(self.obj2078, rootNode)
    self.obj2078.postAction(rootNode.CREATE)

    self.obj2079 = intoMaterial(self)
    self.obj2079.isGraphObjectVisual = True

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

    # rate
    self.obj2079.rate.setValue(0.25)

    self.obj2079.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(36.9868329805, 148.33772234, self.obj2079)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj2079.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj2079)
    self.globalAndLocalPostcondition(self.obj2079, rootNode)
    self.obj2079.postAction(rootNode.CREATE)

    # Connections for obj2050 (graphObject_: Obj1645) of type rawMaterial
    self.drawConnections((self.obj2050, self.obj2072, [
        436.0, 56.0, 444.9799045262882, 72.38364473182781, 443.9799045262882,
        88.13364473182781
    ], "true", 3))
    # Connections for obj2051 (graphObject_: Obj1646) of type rawMaterial
    self.drawConnections((self.obj2051, self.obj2073, [
        24.0, 56.0, 32.97990452628816, 72.38364473182781, 31.97990452628816,
        88.13364473182781
    ], "true", 3))
    # Connections for obj2052 (graphObject_: Obj1647) named A1 R1
    self.drawConnections((self.obj2052, self.obj2077, [
        431.0, 126.0, 444.73683298050514, 135.58772233983163,
        448.98683298050514, 148.33772233983163
    ], "true", 3), (self.obj2052, self.obj2078, [
        431.0, 126.0, 392.2429994544884, 151.1201096477546, 349.9929994544884,
        166.8701096477546
    ], "true", 3))
    # Connections for obj2053 (graphObject_: Obj1648) named A2 R2
    self.drawConnections((self.obj2053, self.obj2079, [
        19.0, 126.0, 32.73683298050514, 135.58772233983163, 36.98683298050514,
        148.33772233983163
    ], "true", 3))
    # Connections for obj2054 (graphObject_: Obj1649) named G1 OAF
    self.drawConnections((self.obj2054, self.obj2070, [
        431.0, 468.0, 442.43652968314956, 480.12510984719063,
        443.93652968314956, 493.37510984719063
    ], "true", 3))
    # Connections for obj2055 (graphObject_: Obj1650) named G2 OAF
    self.drawConnections((self.obj2055, self.obj2071, [
        259.0, 468.0, 306.353713602772, 471.6658297869167, 350.853713602772,
        484.9158297869167
    ], "true", 3))
    # Connections for obj2056 (graphObject_: Obj1651) named A1 R1 G1
    self.drawConnections((self.obj2056, self.obj2074, [
        431.0, 297.0, 442.6571157960441, 308.39019979269983, 444.4071157960441,
        321.14019979269983
    ], "true", 3))
    # Connections for obj2057 (graphObject_: Obj1652) named A1 R1 G2
    self.drawConnections((self.obj2057, self.obj2075, [
        225.0, 297.0, 236.65711579604408, 308.39019979269983,
        238.40711579604408, 321.14019979269983
    ], "true", 3))
    # Connections for obj2058 (graphObject_: Obj1653) named A2 R2 G2
    self.drawConnections((self.obj2058, self.obj2076, [
        53.0, 297.0, 97.10237714155916, 302.078664240101, 137.85237714155915,
        316.578664240101
    ], "true", 3))
    # Connections for obj2059 (graphObject_: Obj1654) of type metarial
    self.drawConnections((self.obj2059, self.obj2065, [
        436.0, 399.0, 444.97925308968456, 415.14382277997964,
        443.97925308968456, 430.64382277997964
    ], "true", 3))
    # Connections for obj2060 (graphObject_: Obj1655) of type metarial
    self.drawConnections((self.obj2060, self.obj2066, [
        230.0, 399.0, 238.9792530896846, 415.14382277997964, 237.9792530896846,
        430.64382277997964
    ], "true", 3))
    # Connections for obj2061 (graphObject_: Obj1656) of type metarial
    self.drawConnections((self.obj2061, self.obj2067, [
        446.0, 228.0, 459.68277323709356, 241.0012198097823,
        463.68277323709356, 256.5012198097823
    ], "true", 3))
    # Connections for obj2062 (graphObject_: Obj1657) of type metarial
    self.drawConnections((self.obj2062, self.obj2068, [
        240.0, 228.0, 253.68277323709358, 241.0012198097823,
        257.68277323709356, 256.5012198097823
    ], "true", 3))
    # Connections for obj2063 (graphObject_: Obj1658) of type metarial
    self.drawConnections((self.obj2063, self.obj2069, [
        34.0, 228.0, 47.68277323709358, 241.0012198097823, 51.68277323709358,
        256.5012198097823
    ], "true", 3))
    # Connections for obj2064 (graphObject_: Obj1659) of type product
    self.drawConnections()
    # Connections for obj2065 (graphObject_: Obj1660) of type fromMaterial
    self.drawConnections((self.obj2065, self.obj2054, [
        443.97925308968456, 430.64382277997964, 442.97925308968456,
        446.14382277997964, 432.0, 461.0
    ], "true", 3))
    # Connections for obj2066 (graphObject_: Obj1662) of type fromMaterial
    self.drawConnections((self.obj2066, self.obj2055, [
        237.9792530896846, 430.64382277997964, 236.9792530896846,
        446.14382277997964, 226.0, 461.0
    ], "true", 3))
    # Connections for obj2067 (graphObject_: Obj1664) of type fromMaterial
    self.drawConnections((self.obj2067, self.obj2056, [
        463.68277323709356, 256.5012198097823, 467.68277323709356,
        272.0012198097823, 462.0, 290.0
    ], "true", 3))
    # Connections for obj2068 (graphObject_: Obj1666) of type fromMaterial
    self.drawConnections((self.obj2068, self.obj2057, [
        257.68277323709356, 256.5012198097823, 261.68277323709356,
        272.0012198097823, 256.0, 290.0
    ], "true", 3))
    # Connections for obj2069 (graphObject_: Obj1668) of type fromMaterial
    self.drawConnections((self.obj2069, self.obj2058, [
        51.68277323709358, 256.5012198097823, 55.68277323709358,
        272.0012198097823, 50.0, 290.0
    ], "true", 3))
    # Connections for obj2070 (graphObject_: Obj1670) of type intoProduct
    self.drawConnections((self.obj2070, self.obj2064, [
        443.93652968314956, 493.37510984719063, 445.43652968314956,
        506.62510984719063, 437.0, 521.0
    ], "true", 3))
    # Connections for obj2071 (graphObject_: Obj1672) of type intoProduct
    self.drawConnections((self.obj2071, self.obj2064, [
        350.853713602772, 484.9158297869167, 395.353713602772,
        498.1658297869167, 437.0, 521.0
    ], "true", 3))
    # Connections for obj2072 (graphObject_: Obj1674) of type fromRaw
    self.drawConnections((self.obj2072, self.obj2052, [
        443.9799045262882, 88.13364473182781, 442.9799045262882,
        103.88364473182781, 432.0, 119.0
    ], "true", 3))
    # Connections for obj2073 (graphObject_: Obj1676) of type fromRaw
    self.drawConnections((self.obj2073, self.obj2053, [
        31.97990452628816, 88.13364473182781, 30.97990452628816,
        103.88364473182781, 20.0, 119.0
    ], "true", 3))
    # Connections for obj2074 (graphObject_: Obj1678) of type intoMaterial
    self.drawConnections((self.obj2074, self.obj2059, [
        444.4071157960441, 321.14019979269983, 446.1571157960441,
        333.89019979269983, 438.0, 348.0
    ], "true", 3))
    # Connections for obj2075 (graphObject_: Obj1680) of type intoMaterial
    self.drawConnections((self.obj2075, self.obj2060, [
        238.40711579604408, 321.14019979269983, 240.15711579604408,
        333.89019979269983, 232.0, 348.0
    ], "true", 3))
    # Connections for obj2076 (graphObject_: Obj1682) of type intoMaterial
    self.drawConnections((self.obj2076, self.obj2060, [
        137.85237714155915, 316.578664240101, 178.60237714155915,
        331.078664240101, 216.0, 355.0
    ], "true", 3))
    # Connections for obj2077 (graphObject_: Obj1684) of type intoMaterial
    self.drawConnections((self.obj2077, self.obj2061, [
        448.98683298050514, 148.33772233983163, 453.23683298050514,
        161.08772233983163, 448.0, 177.0
    ], "true", 3))
    # Connections for obj2078 (graphObject_: Obj1686) of type intoMaterial
    self.drawConnections((self.obj2078, self.obj2062, [
        349.9929994544884, 166.8701096477546, 307.7429994544884,
        182.6201096477546, 262.0, 189.0
    ], "true", 3))
    # Connections for obj2079 (graphObject_: Obj1688) of type intoMaterial
    self.drawConnections((self.obj2079, self.obj2063, [
        36.98683298050514, 148.33772233983163, 41.23683298050514,
        161.08772233983163, 36.0, 177.0
    ], "true", 3))
コード例 #13
0
def neighbors(coord):
    return {coord + Coord(*xy) for xy in product([-1, 0, 1], repeat=2)}
コード例 #14
0
ファイル: pnsEx1_MDL.py プロジェクト: elhoussam/Formalism
def pnsEx1_MDL(self, rootNode, pnsRootNode=None):

    # --- Generating attributes code for ASG pns ---
    if (pnsRootNode):
        # author
        pnsRootNode.author.setValue('Annonymous')

        # description
        pnsRootNode.description.setValue('\n')
        pnsRootNode.description.setHeight(15)

        # name
        pnsRootNode.name.setValue('')
        pnsRootNode.name.setNone()
    # --- ASG attributes over ---

    self.obj1028 = rawMaterial(self)
    self.obj1028.isGraphObjectVisual = True

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

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

    # price
    self.obj1028.price.setValue(5)

    # Name
    self.obj1028.Name.setValue('A1')

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

    self.obj1028.graphClass_ = graph_rawMaterial
    if self.genGraphics:
        new_obj = graph_rawMaterial(206, 0, self.obj1028)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("rawMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1028.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1028)
    self.globalAndLocalPostcondition(self.obj1028, rootNode)
    self.obj1028.postAction(rootNode.CREATE)

    self.obj1029 = operatingUnit(self)
    self.obj1029.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj1029.OperCostProp.setValue(0.5)

    # name
    self.obj1029.name.setValue('A1 R1')

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

    self.obj1029.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(206, 108, self.obj1029)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1029.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1029)
    self.globalAndLocalPostcondition(self.obj1029, rootNode)
    self.obj1029.postAction(rootNode.CREATE)

    self.obj1030 = operatingUnit(self)
    self.obj1030.isGraphObjectVisual = True

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

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

    # name
    self.obj1030.name.setValue('G1 OAF')

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

    self.obj1030.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(0, 450, self.obj1030)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1030.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1030)
    self.globalAndLocalPostcondition(self.obj1030, rootNode)
    self.obj1030.postAction(rootNode.CREATE)

    self.obj1031 = operatingUnit(self)
    self.obj1031.isGraphObjectVisual = True

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

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

    # name
    self.obj1031.name.setValue('G2 OAF')

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

    self.obj1031.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(206, 450, self.obj1031)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1031.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1031)
    self.globalAndLocalPostcondition(self.obj1031, rootNode)
    self.obj1031.postAction(rootNode.CREATE)

    self.obj1032 = operatingUnit(self)
    self.obj1032.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj1032.OperCostProp.setValue(0.11)

    # name
    self.obj1032.name.setValue('A1 R1 G1')

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

    self.obj1032.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(0, 279, self.obj1032)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1032.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1032)
    self.globalAndLocalPostcondition(self.obj1032, rootNode)
    self.obj1032.postAction(rootNode.CREATE)

    self.obj1033 = operatingUnit(self)
    self.obj1033.isGraphObjectVisual = True

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

    # OperCostProp
    self.obj1033.OperCostProp.setValue(0.12)

    # name
    self.obj1033.name.setValue('A1 R1 G2')

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

    self.obj1033.graphClass_ = graph_operatingUnit
    if self.genGraphics:
        new_obj = graph_operatingUnit(206, 279, self.obj1033)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("operatingUnit", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1033.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1033)
    self.globalAndLocalPostcondition(self.obj1033, rootNode)
    self.obj1033.postAction(rootNode.CREATE)

    self.obj1034 = metarial(self)
    self.obj1034.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj1034.Name.setValue('G1')

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

    self.obj1034.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(0, 350, self.obj1034)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1034.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1034)
    self.globalAndLocalPostcondition(self.obj1034, rootNode)
    self.obj1034.postAction(rootNode.CREATE)

    self.obj1035 = metarial(self)
    self.obj1035.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj1035.Name.setValue('G2')

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

    self.obj1035.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(206, 350, self.obj1035)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1035.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1035)
    self.globalAndLocalPostcondition(self.obj1035, rootNode)
    self.obj1035.postAction(rootNode.CREATE)

    self.obj1036 = metarial(self)
    self.obj1036.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj1036.Name.setValue('A1 R1 G1')

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

    self.obj1036.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(0, 179, self.obj1036)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1036.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1036)
    self.globalAndLocalPostcondition(self.obj1036, rootNode)
    self.obj1036.postAction(rootNode.CREATE)

    self.obj1037 = metarial(self)
    self.obj1037.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj1037.Name.setValue('A1 R1 G2')

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

    self.obj1037.graphClass_ = graph_metarial
    if self.genGraphics:
        new_obj = graph_metarial(206, 179, self.obj1037)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("metarial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1037.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1037)
    self.globalAndLocalPostcondition(self.obj1037, rootNode)
    self.obj1037.postAction(rootNode.CREATE)

    self.obj1038 = product(self)
    self.obj1038.isGraphObjectVisual = True

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

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

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

    # Name
    self.obj1038.Name.setValue('OAF')

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

    self.obj1038.graphClass_ = graph_product
    if self.genGraphics:
        new_obj = graph_product(206, 521, self.obj1038)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("product", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1038.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1038)
    self.globalAndLocalPostcondition(self.obj1038, rootNode)
    self.obj1038.postAction(rootNode.CREATE)

    self.obj1039 = fromMaterial(self)
    self.obj1039.isGraphObjectVisual = True

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

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

    self.obj1039.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(32.005065672, 430.467211341, self.obj1039)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1039.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1039)
    self.globalAndLocalPostcondition(self.obj1039, rootNode)
    self.obj1039.postAction(rootNode.CREATE)

    self.obj1040 = fromMaterial(self)
    self.obj1040.isGraphObjectVisual = True

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

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

    self.obj1040.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(238.207284862, 430.669455243,
                                     self.obj1040)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1040.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1040)
    self.globalAndLocalPostcondition(self.obj1040, rootNode)
    self.obj1040.postAction(rootNode.CREATE)

    self.obj1041 = fromMaterial(self)
    self.obj1041.isGraphObjectVisual = True

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

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

    self.obj1041.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(51.4550432196, 256.476547823,
                                     self.obj1041)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1041.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1041)
    self.globalAndLocalPostcondition(self.obj1041, rootNode)
    self.obj1041.postAction(rootNode.CREATE)

    self.obj1042 = fromMaterial(self)
    self.obj1042.isGraphObjectVisual = True

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

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

    self.obj1042.graphClass_ = graph_fromMaterial
    if self.genGraphics:
        new_obj = graph_fromMaterial(257.45504322, 256.476547823, self.obj1042)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1042.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1042)
    self.globalAndLocalPostcondition(self.obj1042, rootNode)
    self.obj1042.postAction(rootNode.CREATE)

    self.obj1043 = intoProduct(self)
    self.obj1043.isGraphObjectVisual = True

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

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

    self.obj1043.graphClass_ = graph_intoProduct
    if self.genGraphics:
        new_obj = graph_intoProduct(144.868478175, 484.858273262, self.obj1043)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoProduct", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1043.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1043)
    self.globalAndLocalPostcondition(self.obj1043, rootNode)
    self.obj1043.postAction(rootNode.CREATE)

    self.obj1044 = intoProduct(self)
    self.obj1044.isGraphObjectVisual = True

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

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

    self.obj1044.graphClass_ = graph_intoProduct
    if self.genGraphics:
        new_obj = graph_intoProduct(238.187112626, 493.499100791, self.obj1044)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoProduct", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1044.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1044)
    self.globalAndLocalPostcondition(self.obj1044, rootNode)
    self.obj1044.postAction(rootNode.CREATE)

    self.obj1045 = fromRaw(self)
    self.obj1045.isGraphObjectVisual = True

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

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

    self.obj1045.graphClass_ = graph_fromRaw
    if self.genGraphics:
        new_obj = graph_fromRaw(237.772666213, 87.9637186904, self.obj1045)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("fromRaw", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1045.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1045)
    self.globalAndLocalPostcondition(self.obj1045, rootNode)
    self.obj1045.postAction(rootNode.CREATE)

    self.obj1046 = intoMaterial(self)
    self.obj1046.isGraphObjectVisual = True

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

    # rate
    self.obj1046.rate.setValue(0.11)

    self.obj1046.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(32.4226168069, 321.008573698,
                                     self.obj1046)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1046.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1046)
    self.globalAndLocalPostcondition(self.obj1046, rootNode)
    self.obj1046.postAction(rootNode.CREATE)

    self.obj1047 = intoMaterial(self)
    self.obj1047.isGraphObjectVisual = True

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

    # rate
    self.obj1047.rate.setValue(0.12)

    self.obj1047.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(238.390600655, 321.222839546,
                                     self.obj1047)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1047.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1047)
    self.globalAndLocalPostcondition(self.obj1047, rootNode)
    self.obj1047.postAction(rootNode.CREATE)

    self.obj1048 = intoMaterial(self)
    self.obj1048.isGraphObjectVisual = True

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

    # rate
    self.obj1048.rate.setValue(0.5)

    self.obj1048.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(143.686831985, 166.822062776,
                                     self.obj1048)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1048.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1048)
    self.globalAndLocalPostcondition(self.obj1048, rootNode)
    self.obj1048.postAction(rootNode.CREATE)

    self.obj1049 = intoMaterial(self)
    self.obj1049.isGraphObjectVisual = True

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

    # rate
    self.obj1049.rate.setValue(0.5)

    self.obj1049.graphClass_ = graph_intoMaterial
    if self.genGraphics:
        new_obj = graph_intoMaterial(242.68883419, 148.342483174, self.obj1049)
        new_obj.DrawObject(self.UMLmodel)
        self.UMLmodel.addtag_withtag("intoMaterial", new_obj.tag)
        new_obj.layConstraints = dict()  # Graphical Layout Constraints
        new_obj.layConstraints['scale'] = [1.0, 1.0]
    else:
        new_obj = None
    self.obj1049.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1049)
    self.globalAndLocalPostcondition(self.obj1049, rootNode)
    self.obj1049.postAction(rootNode.CREATE)

    # Connections for obj1028 (graphObject_: Obj713) of type rawMaterial
    self.drawConnections((self.obj1028, self.obj1045, [
        229.7927616866, 55.830073958000014, 238.77266621273276,
        72.21371869016248, 237.77266621258278, 87.96371869041248
    ], "true", 3))
    # Connections for obj1029 (graphObject_: Obj714) named A1 R1
    self.drawConnections((self.obj1029, self.obj1048, [
        224.792761686, 125.830073959, 185.99042726423008, 151.00958126939372,
        143.68683198473008, 166.82206277614372
    ], "true", 3), (self.obj1029, self.obj1049, [
        224.792761686, 125.830073959, 238.49242946992584, 135.53000166744766,
        242.68883419042584, 148.34248317419767
    ], "true", 3))
    # Connections for obj1030 (graphObject_: Obj715) named G1 OAF
    self.drawConnections((self.obj1030, self.obj1043, [
        53.0172746084, 467.88123386200004, 100.37279682732834,
        471.57858172741805, 144.86847817522835, 484.85827326191804
    ], "true", 3))
    # Connections for obj1031 (graphObject_: Obj716) named G2 OAF
    self.drawConnections((self.obj1031, self.obj1044, [
        225.482036654, 468.072046504, 236.80762178979543, 480.2671124172909,
        238.18711262629543, 493.49910079129086
    ], "true", 3))
    # Connections for obj1032 (graphObject_: Obj717) named A1 R1 G1
    self.drawConnections((self.obj1032, self.obj1046, [
        19.0, 297.0, 30.663979502928797, 308.3179567678522, 32.422616806928794,
        321.00857369835217
    ], "true", 3))
    # Connections for obj1033 (graphObject_: Obj718) named A1 R1 G2
    self.drawConnections((self.obj1033, self.obj1047, [
        225.0, 297.0, 236.6495823288382, 308.4368162949629, 238.39060065533818,
        321.2228395464629
    ], "true", 3))
    # Connections for obj1034 (graphObject_: Obj719) of type metarial
    self.drawConnections((self.obj1034, self.obj1039, [
        24.034549215999988, 398.7624677220001, 33.009384323918454,
        414.9375198057641, 32.00506567201846, 430.4672113407641
    ], "true", 3))
    # Connections for obj1035 (graphObject_: Obj720) of type metarial
    self.drawConnections((self.obj1035, self.obj1040, [
        229.964073306, 399.14409300600005, 239.07779402486605,
        415.18746686842474, 238.20728486186607, 430.6694552429247
    ], "true", 3))
    # Connections for obj1036 (graphObject_: Obj721) of type metarial
    self.drawConnections((self.obj1036, self.obj1041, [
        33.578380568, 228.07999998599996, 47.34963836160739, 240.9965478196302,
        51.45504321960739, 256.4765478231302
    ], "true", 3))
    # Connections for obj1037 (graphObject_: Obj722) of type metarial
    self.drawConnections((self.obj1037, self.obj1042, [
        239.578380568, 228.07999998600008, 253.34963836160736,
        240.99654781963028, 257.4550432196074, 256.47654782313026
    ], "true", 3))
    # Connections for obj1038 (graphObject_: Obj723) of type product
    self.drawConnections()
    # Connections for obj1039 (graphObject_: Obj724) of type fromMaterial
    self.drawConnections((self.obj1039, self.obj1030, [
        32.00506567201846, 430.4672113407641, 31.00074702011846,
        445.9969028757641, 20.0172746084, 460.88123386200004
    ], "true", 3))
    # Connections for obj1040 (graphObject_: Obj726) of type fromMaterial
    self.drawConnections((self.obj1040, self.obj1031, [
        238.20728486186607, 430.6694552429247, 237.3367756988661,
        446.15144361742466, 226.482036654, 461.072046504
    ], "true", 3))
    # Connections for obj1041 (graphObject_: Obj728) of type fromMaterial
    self.drawConnections((self.obj1041, self.obj1032, [
        51.45504321960739, 256.4765478231302, 55.56044807760739,
        271.95654782663024, 50.0, 290.0
    ], "true", 3))
    # Connections for obj1042 (graphObject_: Obj730) of type fromMaterial
    self.drawConnections((self.obj1042, self.obj1033, [
        257.4550432196074, 256.47654782313026, 261.5604480776074,
        271.95654782663024, 256.0, 290.0
    ], "true", 3))
    # Connections for obj1043 (graphObject_: Obj732) of type intoProduct
    self.drawConnections((self.obj1043, self.obj1038, [
        144.86847817522835, 484.85827326191804, 189.3641595231283,
        498.13796479641803, 231.0, 521.0
    ], "true", 3))
    # Connections for obj1044 (graphObject_: Obj734) of type intoProduct
    self.drawConnections((self.obj1044, self.obj1038, [
        238.18711262629543, 493.49910079129086, 239.56660346279543,
        506.7310891652908, 231.0, 521.0
    ], "true", 3))
    # Connections for obj1045 (graphObject_: Obj736) of type fromRaw
    self.drawConnections((self.obj1045, self.obj1029, [
        237.77266621258278, 87.96371869041248, 236.7726662124328,
        103.71371869066247, 225.792761686, 118.830073959
    ], "true", 3))
    # Connections for obj1046 (graphObject_: Obj738) of type intoMaterial
    self.drawConnections((self.obj1046, self.obj1034, [
        32.422616806928794, 321.00857369835217, 34.18125411092879,
        333.69919062885214, 26.034549215999988, 347.762467722
    ], "true", 3))
    # Connections for obj1047 (graphObject_: Obj740) of type intoMaterial
    self.drawConnections((self.obj1047, self.obj1035, [
        238.39060065533818, 321.2228395464629, 240.13161898183816,
        334.00886279796293, 231.964073306, 348.14409300600005
    ], "true", 3))
    # Connections for obj1048 (graphObject_: Obj742) of type intoMaterial
    self.drawConnections((self.obj1048, self.obj1036, [
        143.68683198473008, 166.82206277614372, 101.38323670523008,
        182.63454428289373, 55.57838056800006, 189.07999998599996
    ], "true", 3))
    # Connections for obj1049 (graphObject_: Obj744) of type intoMaterial
    self.drawConnections((self.obj1049, self.obj1037, [
        242.68883419042584, 148.34248317419767, 246.88523891092584,
        161.15496468094767, 241.578380568, 177.07999998600002
    ], "true", 3))
コード例 #15
0
    def __init__(self, parent):
        GGrule.__init__(self, 6)
        self.TimeDelay = ATOM3Integer(2)
        self.exactMatch = 1
        self.LHS = ASG_pns(parent)

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

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

        # MaxFlow
        self.obj965.MaxFlow.setNone()

        # price
        self.obj965.price.setNone()

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

        # ReqFlow
        self.obj965.ReqFlow.setNone()

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

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

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

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

        # OperCostProp
        self.obj966.OperCostProp.setNone()

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

        # OperCostFix
        self.obj966.OperCostFix.setNone()

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

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

        self.obj967 = intoProduct(parent)
        self.obj967.preAction(self.LHS.CREATE)
        self.obj967.isGraphObjectVisual = True

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

        # rate
        self.obj967.rate.setNone()

        self.obj967.GGLabel.setValue(3)
        self.obj967.graphClass_ = graph_intoProduct
        if parent.genGraphics:
            new_obj = graph_intoProduct(239.0, 89.0, self.obj967)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj967.graphObject_ = new_obj

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

        self.obj966.out_connections_.append(self.obj967)
        self.obj967.in_connections_.append(self.obj966)
        self.obj966.graphObject_.pendingConnections.append(
            (self.obj966.graphObject_.tag, self.obj967.graphObject_.tag,
             [233.0, 38.0, 239.0, 89.0], 0, True))
        self.obj967.out_connections_.append(self.obj965)
        self.obj965.in_connections_.append(self.obj967)
        self.obj967.graphObject_.pendingConnections.append(
            (self.obj967.graphObject_.tag, self.obj965.graphObject_.tag,
             [245.0, 140.0, 239.0, 89.0], 0, True))

        self.RHS = ASG_pns(parent)

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

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

        # MaxFlow
        self.obj969.MaxFlow.setNone()

        # price
        self.obj969.price.setNone()

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

        # ReqFlow
        self.obj969.ReqFlow.setNone()

        self.obj969.GGLabel.setValue(2)
        self.obj969.graphClass_ = graph_product
        if parent.genGraphics:
            new_obj = graph_product(220.0, 140.0, self.obj969)
            new_obj.layConstraints = dict()  # Graphical Layout Constraints
            new_obj.layConstraints['scale'] = [1.0, 1.0]
        else:
            new_obj = None
        self.obj969.graphObject_ = new_obj
        self.obj9690 = AttrCalc()
        self.obj9690.Copy = ATOM3Boolean()
        self.obj9690.Copy.setValue(('Copy from LHS', 1))
        self.obj9690.Copy.config = 0
        self.obj9690.Specify = ATOM3Constraint()
        self.obj9690.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.obj969.GGset2Any['MaxFlow'] = self.obj9690
        self.obj9691 = AttrCalc()
        self.obj9691.Copy = ATOM3Boolean()
        self.obj9691.Copy.setValue(('Copy from LHS', 1))
        self.obj9691.Copy.config = 0
        self.obj9691.Specify = ATOM3Constraint()
        self.obj9691.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.obj969.GGset2Any['price'] = self.obj9691
        self.obj9692 = AttrCalc()
        self.obj9692.Copy = ATOM3Boolean()
        self.obj9692.Copy.setValue(('Copy from LHS', 1))
        self.obj9692.Copy.config = 0
        self.obj9692.Specify = ATOM3Constraint()
        self.obj9692.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.obj969.GGset2Any['Name'] = self.obj9692
        self.obj9693 = AttrCalc()
        self.obj9693.Copy = ATOM3Boolean()
        self.obj9693.Copy.setValue(('Copy from LHS', 1))
        self.obj9693.Copy.config = 0
        self.obj9693.Specify = ATOM3Constraint()
        self.obj9693.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.obj969.GGset2Any['ReqFlow'] = self.obj9693

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

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

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

        # OperCostProp
        self.obj970.OperCostProp.setNone()

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

        # OperCostFix
        self.obj970.OperCostFix.setNone()

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

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

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

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

        # rate
        self.obj971.rate.setNone()

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

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

        self.obj970.out_connections_.append(self.obj971)
        self.obj971.in_connections_.append(self.obj970)
        self.obj970.graphObject_.pendingConnections.append(
            (self.obj970.graphObject_.tag, self.obj971.graphObject_.tag,
             [233.0, 28.0, 239.0, 89.0], 2, 0))
        self.obj971.out_connections_.append(self.obj969)
        self.obj969.in_connections_.append(self.obj971)
        self.obj971.graphObject_.pendingConnections.append(
            (self.obj971.graphObject_.tag, self.obj969.graphObject_.tag,
             [245.0, 140.0, 239.0, 89.0], 2, 0))
コード例 #16
0
ファイル: main.py プロジェクト: sagarsaji/Proj1
import sums
import diff
import product
import division

print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")

# Take input from the user
choice = input("Enter choice(1/2/3/4): ")

num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))

if choice == '1':
    print(num1, "+", num2, "=", sums(num1, num2))

elif choice == '2':
    print(num1, "-", num2, "=", diff(num1, num2))

elif choice == '3':
    print(num1, "*", num2, "=", product(num1, num2))

elif choice == '4':
    print(num1, "/", num2, "=", division(num1, num2))
else:
    print("Invalid input")