from graph_ASG_UMLmetaMetaModel import *
from ASG_GPSSModel2 import *
from ASG_GPSSModel2 import *
from Storage_Size import *
from Table import *
from Function import *
from SNAVariable import *
from GPSSBlock import *
from ATOM3Integer import *
from ATOM3Appearance import *
from ATOM3Float import *
from Point import *
from ATOM3Boolean import *
from ATOM3List import *
from ATOM3Enum import *
from ATOM3Attribute import *
from ATOM3Constraint import *
from ATOM3String import *
from ATOM3BottomType import *
from ControlStatement import *

def model(self, rootNode):
    rootNode.Author.setValue('')
    rootNode.Control_Statements.setActionFlags([ 1, 1, 1, 0])
    lcobj1 =[]
    cobj1= CommandXAXBXC()
    cobj1.Command=ATOM3Enum(['START', 'CLEAR', 'RESET'],0,0)
    cobj1.A=ATOM3String('100')
    cobj1.B=ATOM3String('')
    cobj1.C=ATOM3String('')
    lcobj1.append(cobj1)
    rootNode.Control_Statements.setValue(lcobj1)
    rootNode.Name.setValue('')

    self.globalPrecondition()

    self.obj14=Table(self)

    self.obj14.Label.setValue('1')
    self.obj14.Number_Of_Intervals.setValue('10')
    self.obj14.Type.setValue('M1')
    self.obj14.Lower_Limit.setValue('5')
    self.obj14.Interval_Size.setValue('5')
    self.obj14.graphClass_= graph_Table
    new_obj = graph_Table(470.0,522.0,self.obj14)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("Table", new_obj.tag)
    self.obj14.graphObject_ = new_obj
    rootNode.addNode(self.obj14)
    self.globalAndLocalPostcondition(self.obj14)

    self.globalPrecondition()

    self.obj15=Function(self)

    self.obj15.Function_Number.setValue('1')
    self.obj15.Mode.setValue( (['Continuous', 'Discrete'], 1) )
    self.obj15.Mode.config = 0
    self.obj15.Points.setActionFlags([ 1, 1, 1, 0])
    lcobj1 =[]
    cobj1= xXy()
    cobj1.x=ATOM3Float(0.5)
    cobj1.y=ATOM3Float(1.0)
    lcobj1.append(cobj1)
    cobj1= xXy()
    cobj1.x=ATOM3Float(0.7)
    cobj1.y=ATOM3Float(2.0)
    lcobj1.append(cobj1)
    cobj1= xXy()
    cobj1.x=ATOM3Float(0.9)
    cobj1.y=ATOM3Float(3.0)
    lcobj1.append(cobj1)
    cobj1= xXy()
    cobj1.x=ATOM3Float(1.0)
    cobj1.y=ATOM3Float(4.0)
    lcobj1.append(cobj1)
    self.obj15.Points.setValue(lcobj1)
    self.obj15.Input.setValue('RN1')
    self.obj15.Number_Of_Points.setValue(4)
    self.obj15.graphClass_= graph_Function
    new_obj = graph_Function(473.0,283.0,self.obj15)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("Function", new_obj.tag)
    self.obj15.graphObject_ = new_obj
    rootNode.addNode(self.obj15)
    self.globalAndLocalPostcondition(self.obj15)

    self.globalPrecondition()

    self.obj16=SNAVariable(self)

    self.obj16.Type.setValue( (['Integer', 'Float', 'Boolean'], 0) )
    self.obj16.Type.config = 0
    self.obj16.Name.setValue('1')
    self.obj16.Expression.setValue('PH1*5')
    self.obj16.graphClass_= graph_SNAVariable
    new_obj = graph_SNAVariable(472.0,382.0,self.obj16)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("SNAVariable", new_obj.tag)
    self.obj16.graphObject_ = new_obj
    rootNode.addNode(self.obj16)
    self.globalAndLocalPostcondition(self.obj16)

    self.globalPrecondition()

    self.obj17=GPSSBlock(self)

    self.obj17.Label.setValue('L0')
    self.obj17.Comments.setValue('Compute # of items purchased')
    self.obj17.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 1) )
    self.obj17.Type.config = 0
    self.obj17.X.setValue('')
    self.obj17.F.setValue('')
    self.obj17.D.setValue('')
    self.obj17.E.setValue('')
    self.obj17.B.setValue('FN1')
    self.obj17.C.setValue('H')
    self.obj17.A.setValue('1')
    self.obj17.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(261.0,300.0,self.obj17)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj17.graphObject_ = new_obj
    rootNode.addNode(self.obj17)
    self.globalAndLocalPostcondition(self.obj17)

    self.globalPrecondition()

    self.obj18=GPSSBlock(self)

    self.obj18.Label.setValue('L1')
    self.obj18.Comments.setValue('Compute time for purchase')
    self.obj18.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 0) )
    self.obj18.Type.config = 0
    self.obj18.X.setValue('')
    self.obj18.F.setValue('')
    self.obj18.D.setValue('')
    self.obj18.E.setValue('')
    self.obj18.B.setValue('')
    self.obj18.C.setValue('')
    self.obj18.A.setValue('V1')
    self.obj18.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(303.0,378.0,self.obj18)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj18.graphObject_ = new_obj
    rootNode.addNode(self.obj18)
    self.globalAndLocalPostcondition(self.obj18)

    self.globalPrecondition()

    self.obj19=GPSSBlock(self)

    self.obj19.Label.setValue('L2')
    self.obj19.Comments.setValue('Release (leave) server counter')
    self.obj19.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 12) )
    self.obj19.Type.config = 0
    self.obj19.X.setValue('')
    self.obj19.F.setValue('')
    self.obj19.D.setValue('')
    self.obj19.E.setValue('')
    self.obj19.B.setValue('')
    self.obj19.C.setValue('')
    self.obj19.A.setValue('1')
    self.obj19.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(293.0,448.0,self.obj19)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj19.graphObject_ = new_obj
    rootNode.addNode(self.obj19)
    self.globalAndLocalPostcondition(self.obj19)

    self.globalPrecondition()

    self.obj20=GPSSBlock(self)

    self.obj20.Label.setValue('L3')
    self.obj20.Comments.setValue('Tabulate time for serving')
    self.obj20.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 15) )
    self.obj20.Type.config = 0
    self.obj20.X.setValue('')
    self.obj20.F.setValue('')
    self.obj20.D.setValue('')
    self.obj20.E.setValue('')
    self.obj20.B.setValue('')
    self.obj20.C.setValue('')
    self.obj20.A.setValue('1')
    self.obj20.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(293.0,535.0,self.obj20)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj20.graphObject_ = new_obj
    rootNode.addNode(self.obj20)
    self.globalAndLocalPostcondition(self.obj20)

    self.globalPrecondition()

    self.obj21=GPSSBlock(self)

    self.obj21.Label.setValue('L4')
    self.obj21.Comments.setValue('Leave server counter')
    self.obj21.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 16) )
    self.obj21.Type.config = 0
    self.obj21.X.setValue('')
    self.obj21.F.setValue('')
    self.obj21.D.setValue('')
    self.obj21.E.setValue('')
    self.obj21.B.setValue('')
    self.obj21.C.setValue('')
    self.obj21.A.setValue('1')
    self.obj21.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(307.0,620.0,self.obj21)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj21.graphObject_ = new_obj
    rootNode.addNode(self.obj21)
    self.globalAndLocalPostcondition(self.obj21)

    self.globalPrecondition()

    self.obj22=GPSSBlock(self)

    self.obj22.Label.setValue('L5')
    self.obj22.Comments.setValue('Depart from the queue')
    self.obj22.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 2) )
    self.obj22.Type.config = 0
    self.obj22.X.setValue('')
    self.obj22.F.setValue('')
    self.obj22.D.setValue('')
    self.obj22.E.setValue('')
    self.obj22.B.setValue('')
    self.obj22.C.setValue('')
    self.obj22.A.setValue('1')
    self.obj22.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(303.0,229.0,self.obj22)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj22.graphObject_ = new_obj
    rootNode.addNode(self.obj22)
    self.globalAndLocalPostcondition(self.obj22)

    self.globalPrecondition()

    self.obj23=GPSSBlock(self)

    self.obj23.Label.setValue('L6')
    self.obj23.Comments.setValue('A single server counter')
    self.obj23.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 14) )
    self.obj23.Type.config = 0
    self.obj23.X.setValue('')
    self.obj23.F.setValue('')
    self.obj23.D.setValue('')
    self.obj23.E.setValue('')
    self.obj23.B.setValue('')
    self.obj23.C.setValue('')
    self.obj23.A.setValue('1')
    self.obj23.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(294.0,149.0,self.obj23)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj23.graphObject_ = new_obj
    rootNode.addNode(self.obj23)
    self.globalAndLocalPostcondition(self.obj23)

    self.globalPrecondition()

    self.obj24=GPSSBlock(self)

    self.obj24.Label.setValue('L7')
    self.obj24.Comments.setValue('Waiting queue for server counter')
    self.obj24.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 11) )
    self.obj24.Type.config = 0
    self.obj24.X.setValue('')
    self.obj24.F.setValue('')
    self.obj24.D.setValue('')
    self.obj24.E.setValue('')
    self.obj24.B.setValue('')
    self.obj24.C.setValue('')
    self.obj24.A.setValue('1')
    self.obj24.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(304.0,73.0,self.obj24)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj24.graphObject_ = new_obj
    rootNode.addNode(self.obj24)
    self.globalAndLocalPostcondition(self.obj24)

    self.globalPrecondition()

    self.obj25=GPSSBlock(self)

    self.obj25.Label.setValue('L8')
    self.obj25.Comments.setValue('Inter-arrival time of 20pm10')
    self.obj25.Type.setValue( (['Advance', 'Assign', 'Depart', 'Enter', 'Gate', 'Generate', 'Leave', 'Link', 'Logic', 'Mark', 'Priority', 'Queue', 'Release', 'SaveValue', 'Seize', 'Tabulate', 'Terminate', 'Test', 'Transfer', 'Unlink'], 5) )
    self.obj25.Type.config = 0
    self.obj25.X.setValue('')
    self.obj25.F.setValue('')
    self.obj25.D.setValue('')
    self.obj25.E.setValue('')
    self.obj25.B.setValue('10')
    self.obj25.C.setValue('')
    self.obj25.A.setValue('20')
    self.obj25.graphClass_= graph_GPSSBlock
    new_obj = graph_GPSSBlock(308.0,5.0,self.obj25)
    new_obj.DrawObject(self.UMLmodel)
    self.UMLmodel.addtag_withtag("GPSSBlock", new_obj.tag)
    self.obj25.graphObject_ = new_obj
    rootNode.addNode(self.obj25)
    self.globalAndLocalPostcondition(self.obj25)
    self.drawConnections((self.obj17,self.obj18), (self.obj18,self.obj19), (self.obj19,self.obj20), (self.obj20,self.obj21), (self.obj22,self.obj17), (self.obj23,self.obj22), (self.obj24,self.obj23), (self.obj25,self.obj24) )

newfunction = model

loadedMMName = 'GPSSModel2'
