"""
__ballMove_MDL.py_____________________________________________________

Automatically generated AToM3 Model File (Do not modify directly)
Author: kyle
Modified: Tue Apr 29 23:43:00 2008
______________________________________________________________________
"""
from stickylink import *
from widthXfillXdecoration import *
from Composite import *
from Basic import *
from Orthogonal import *
from contains import *
from Hyperedge import *
from orthogonality import *
from graph_Basic import *
from graph_Orthogonal import *
from graph_Hyperedge import *
from graph_orthogonality import *
from graph_contains import *
from graph_Composite import *
from ATOM3Enum import *
from ATOM3String import *
from ATOM3BottomType import *
from ATOM3Constraint import *
from ATOM3Attribute import *
from ATOM3Float import *
from ATOM3List import *
from ATOM3Link import *
from ATOM3Connection import *
from ATOM3Boolean import *
from ATOM3Appearance import *
from ATOM3Text import *
from ATOM3Action import *
from ATOM3Integer import *
from ATOM3Port import *
from ATOM3MSEnum import *

def ballMove_MDL(self, rootNode, DChartsRootNode=None):

    # --- Generating attributes code for ASG DCharts ---
    if( DChartsRootNode ): 
        # variables
        DChartsRootNode.variables.setValue('\n')
        DChartsRootNode.variables.setHeight(15)

        # misc
        DChartsRootNode.misc.setValue('\n')
        DChartsRootNode.misc.setHeight(15)

        # event_clauses
        DChartsRootNode.event_clauses.setValue('\n')
        DChartsRootNode.event_clauses.setHeight(15)
    # --- ASG attributes over ---


    self.obj1153=Composite(self)
    self.obj1153.isGraphObjectVisual = True

    if(hasattr(self.obj1153, '_setHierarchicalLink')):
      self.obj1153._setHierarchicalLink(False)

    # auto_adjust
    self.obj1153.auto_adjust.setValue((None, 1))
    self.obj1153.auto_adjust.config = 0

    # name
    self.obj1153.name.setValue('compo_0')

    # is_default
    self.obj1153.is_default.setValue((None, 0))
    self.obj1153.is_default.config = 0

    # visible
    self.obj1153.visible.setValue((None, 1))
    self.obj1153.visible.config = 0

    # exit_action
    self.obj1153.exit_action.setValue('\n')
    self.obj1153.exit_action.setHeight(15)

    # enter_action
    self.obj1153.enter_action.setValue('\n')
    self.obj1153.enter_action.setHeight(15)

    self.obj1153.graphClass_= graph_Composite
    if self.genGraphics:
       new_obj = graph_Composite(280.0,160.0,self.obj1153)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("Composite", new_obj.tag)
       self.UMLmodel.coords(new_obj.gf2.handler,344.0,239.0,572.0,370.0)
       self.UMLmodel.itemconfig(new_obj.gf2.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf2.handler, width='2.0')
       self.UMLmodel.itemconfig(new_obj.gf2.handler, outline='DARKBLUE')
       self.UMLmodel.itemconfig(new_obj.gf2.handler, fill='')
       self.UMLmodel.coords(new_obj.gf1.handler,344.0,232.0)
       self.UMLmodel.itemconfig(new_obj.gf1.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, fill='black')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, text='compo_0')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, width='0')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, font='Helvetica -12')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, anchor='center')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, justify='left')
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj1153.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1153)
    self.globalAndLocalPostcondition(self.obj1153, rootNode)
    self.obj1153.postAction( rootNode.CREATE )

    self.obj1154=Basic(self)
    self.obj1154.isGraphObjectVisual = True

    if(hasattr(self.obj1154, '_setHierarchicalLink')):
      self.obj1154._setHierarchicalLink(False)

    # is_default
    self.obj1154.is_default.setValue((None, 1))
    self.obj1154.is_default.config = 0

    # name
    self.obj1154.name.setValue('init')

    # exit_action
    self.obj1154.exit_action.setValue('\n')
    self.obj1154.exit_action.setHeight(15)

    # enter_action
    self.obj1154.enter_action.setValue('counter = 0\nballs = {}\n')
    self.obj1154.enter_action.setHeight(15)

    self.obj1154.graphClass_= graph_Basic
    if self.genGraphics:
       new_obj = graph_Basic(180.0,160.0,self.obj1154)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("Basic", new_obj.tag)
       self.UMLmodel.coords(new_obj.gf3.handler,192.0,163.0,210.0,181.0)
       self.UMLmodel.itemconfig(new_obj.gf3.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf3.handler, width='2.0')
       self.UMLmodel.itemconfig(new_obj.gf3.handler, outline='DARKGREEN')
       self.UMLmodel.itemconfig(new_obj.gf3.handler, fill='lightgray')
       self.UMLmodel.coords(new_obj.gf1.handler,203.125,190.0)
       self.UMLmodel.itemconfig(new_obj.gf1.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, fill='black')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, text='init')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, width='0')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, font='font87440840')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, anchor='center')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, justify='left')
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj1154.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1154)
    self.globalAndLocalPostcondition(self.obj1154, rootNode)
    self.obj1154.postAction( rootNode.CREATE )

    self.obj1155=Basic(self)
    self.obj1155.isGraphObjectVisual = True

    if(hasattr(self.obj1155, '_setHierarchicalLink')):
      self.obj1155._setHierarchicalLink(False)

    # is_default
    self.obj1155.is_default.setValue((None, 1))
    self.obj1155.is_default.config = 0

    # name
    self.obj1155.name.setValue('moving')

    # exit_action
    self.obj1155.exit_action.setValue('\n')
    self.obj1155.exit_action.setHeight(15)

    # enter_action
    self.obj1155.enter_action.setValue('\n')
    self.obj1155.enter_action.setHeight(15)

    self.obj1155.graphClass_= graph_Basic
    if self.genGraphics:
       new_obj = graph_Basic(420.0,320.0,self.obj1155)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("Basic", new_obj.tag)
       self.UMLmodel.coords(new_obj.gf3.handler,432.0,323.0,450.0,341.0)
       self.UMLmodel.itemconfig(new_obj.gf3.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf3.handler, width='2.0')
       self.UMLmodel.itemconfig(new_obj.gf3.handler, outline='DARKGREEN')
       self.UMLmodel.itemconfig(new_obj.gf3.handler, fill='lightgray')
       self.UMLmodel.coords(new_obj.gf1.handler,443.125,350.0)
       self.UMLmodel.itemconfig(new_obj.gf1.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, fill='black')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, text='moving')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, width='0')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, font='font90189656')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, anchor='center')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, justify='left')
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj1155.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1155)
    self.globalAndLocalPostcondition(self.obj1155, rootNode)
    self.obj1155.postAction( rootNode.CREATE )

    self.obj1156=Orthogonal(self)
    self.obj1156.isGraphObjectVisual = True

    if(hasattr(self.obj1156, '_setHierarchicalLink')):
      self.obj1156._setHierarchicalLink(False)

    # visible
    self.obj1156.visible.setValue((None, 1))
    self.obj1156.visible.config = 0

    # name
    self.obj1156.name.setValue('move_comp')

    # auto_adjust
    self.obj1156.auto_adjust.setValue((None, 1))
    self.obj1156.auto_adjust.config = 0

    self.obj1156.graphClass_= graph_Orthogonal
    if self.genGraphics:
       new_obj = graph_Orthogonal(340.0,220.0,self.obj1156)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("Orthogonal", new_obj.tag)
       self.UMLmodel.coords(new_obj.gf5.handler,384.0,258.0,565.0,363.0)
       self.UMLmodel.itemconfig(new_obj.gf5.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf5.handler, width='2.0')
       self.UMLmodel.itemconfig(new_obj.gf5.handler, outline='DARKGRAY')
       self.UMLmodel.itemconfig(new_obj.gf5.handler, fill='')
       self.UMLmodel.coords(new_obj.gf1.handler,384.0,251.0)
       self.UMLmodel.itemconfig(new_obj.gf1.handler, stipple='')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, fill='black')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, text='move_comp')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, width='0')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, font='Helvetica -12')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, anchor='center')
       self.UMLmodel.itemconfig(new_obj.gf1.handler, justify='left')
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj1156.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1156)
    self.globalAndLocalPostcondition(self.obj1156, rootNode)
    self.obj1156.postAction( rootNode.CREATE )

    self.obj1157=contains(self)
    self.obj1157.isGraphObjectVisual = True

    if(hasattr(self.obj1157, '_setHierarchicalLink')):
      self.obj1157._setHierarchicalLink(False)

    self.obj1157.graphClass_= graph_contains
    if self.genGraphics:
       new_obj = graph_contains(404.931194496,310.723429936,self.obj1157)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("contains", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
    else: new_obj = None
    self.obj1157.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1157)
    self.globalAndLocalPostcondition(self.obj1157, rootNode)
    self.obj1157.postAction( rootNode.CREATE )

    self.obj1158=Hyperedge(self)
    self.obj1158.isGraphObjectVisual = True

    if(hasattr(self.obj1158, '_setHierarchicalLink')):
      self.obj1158._setHierarchicalLink(False)

    # name
    self.obj1158.name.setValue('')
    self.obj1158.name.setNone()

    # broadcast
    self.obj1158.broadcast.setValue('# return an instance of DEVSevent or None\nreturn None\n')
    self.obj1158.broadcast.setHeight(15)

    # guard
    self.obj1158.guard.setValue('1')

    # trigger
    self.obj1158.trigger.setValue('start')

    # action
    self.obj1158.action.setValue('ctl = [PARAMS]\nbid = counter\ncounter += 1\ngid, pos, speed = ctl.init(bid)\nballs[bid] = {\'pos\': pos, \'speed\': speed, \'gid\':gid}\nwidth = ctl.getWidth()\nheight = ctl.getHeight()\n')
    self.obj1158.action.setHeight(15)

    # broadcast_to
    self.obj1158.broadcast_to.setValue('')
    self.obj1158.broadcast_to.setNone()

    # display
    self.obj1158.display.setValue('start')

    self.obj1158.graphClass_= graph_Hyperedge
    if self.genGraphics:
       new_obj = graph_Hyperedge(235.635857318,177.217941475,self.obj1158)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("Hyperedge", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [0.93999999999999961, 1.0399999999999998]
    else: new_obj = None
    self.obj1158.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1158)
    self.globalAndLocalPostcondition(self.obj1158, rootNode)
    self.obj1158.postAction( rootNode.CREATE )

    self.obj1159=Hyperedge(self)
    self.obj1159.isGraphObjectVisual = True

    if(hasattr(self.obj1159, '_setHierarchicalLink')):
      self.obj1159._setHierarchicalLink(False)

    # name
    self.obj1159.name.setValue('')
    self.obj1159.name.setNone()

    # broadcast
    self.obj1159.broadcast.setValue('# return an instance of DEVSevent or None\nreturn None\n')
    self.obj1159.broadcast.setHeight(15)

    # guard
    self.obj1159.guard.setValue('1')

    # trigger
    self.obj1159.trigger.setValue('AFTER(0.01)')

    # action
    self.obj1159.action.setValue('for b in balls: ctl.bounce(b, 0.01)\n')
    self.obj1159.action.setHeight(15)

    # broadcast_to
    self.obj1159.broadcast_to.setValue('')
    self.obj1159.broadcast_to.setNone()

    # display
    self.obj1159.display.setValue('AFTER(0.01)')

    self.obj1159.graphClass_= graph_Hyperedge
    if self.genGraphics:
       new_obj = graph_Hyperedge(495.8,316.0,self.obj1159)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("Hyperedge", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj1159.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1159)
    self.globalAndLocalPostcondition(self.obj1159, rootNode)
    self.obj1159.postAction( rootNode.CREATE )

    self.obj1160=orthogonality(self)
    self.obj1160.isGraphObjectVisual = True

    if(hasattr(self.obj1160, '_setHierarchicalLink')):
      self.obj1160._setHierarchicalLink(False)

    self.obj1160.graphClass_= graph_orthogonality
    if self.genGraphics:
       new_obj = graph_orthogonality(364.0,248.5,self.obj1160)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("orthogonality", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints 
    else: new_obj = None
    self.obj1160.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj1160)
    self.globalAndLocalPostcondition(self.obj1160, rootNode)
    self.obj1160.postAction( rootNode.CREATE )

    # Connections for obj1153 (graphObject_: Obj498) named compo_0
    self.drawConnections(
(self.obj1153,self.obj1160,[345.0, 201.00000000000003, 363.99999999999881, 248.49999999955631],"bezier", 2) )
    # Connections for obj1154 (graphObject_: Obj499) named init
    self.drawConnections(
(self.obj1154,self.obj1158,[210.00191094743789, 171.96502037329131, 235.63585731800001, 177.217941475],"bezier", 2) )
    # Connections for obj1155 (graphObject_: Obj500) named moving
    self.drawConnections(
(self.obj1155,self.obj1159,[436.74796458621154, 324.16809608307045, 392.30000000000007, 265.5, 495.80000000000001, 316.0],"bezier", 3) )
    # Connections for obj1156 (graphObject_: Obj501) named move_comp
    self.drawConnections(
(self.obj1156,self.obj1157,[384.0, 310.00000000000006, 404.93119449599999, 310.723429936],"bezier", 2) )
    # Connections for obj1157 (graphObject_: Obj502) of type contains
    self.drawConnections(
(self.obj1157,self.obj1155,[404.93119449599999, 310.723429936, 416.72556937513104, 323.47957067605591, 433.34320001431377, 327.61979166666663],"bezier", 3) )
    # Connections for obj1158 (graphObject_: Obj503) named 
    self.drawConnections(
(self.obj1158,self.obj1153,[235.63585731800001, 177.217941475, 261.68427093554925, 193.35912920452805, 345.0, 304.0],"bezier", 3) )
    # Connections for obj1159 (graphObject_: Obj505) named 
    self.drawConnections(
(self.obj1159,self.obj1155,[495.80000000000001, 316.0, 507.79999999999995, 342.39999999999998, 450.00191094743786, 331.96502037329128],"bezier", 3) )
    # Connections for obj1160 (graphObject_: Obj507) of type orthogonality
    self.drawConnections(
(self.obj1160,self.obj1156,[363.99999999999875, 248.49999999955631, 370.49999999999881, 257.49999999955639, 345.0, 262.99999999999994],"bezier", 3) )

newfunction = ballMove_MDL

loadedMMName = 'DCharts'

atom3version = '0.3'
