示例#1
0
def runga(context):
    
    from iga.gacommon import gaParams

    filename = context.get('app_name', 'funcopt.yml')
    gaParams.fileArgs('config/' + filename)
    pop = gaParams.consoleGA()

    return pop
    except:
        print 'No psyco! Oh well...'

    args = parse()

    from iga.gacommon import gaParams
    if args.has_key('config'):
        filename = args['config']
        if not filename.startswith('config'):
            filename = 'config/' + filename
        gaParams.fileArgs(filename)
    else:
        gaParams.fileArgs('config/floorplan.yml')

    gaParams.setArgs(args)

    if gaParams.getVar('mode') == 'ga':
        gaParams.consoleGA()
    else:
        from gui import gawindow
        import wx

        app = wx.PySimpleApp()

        gaWindow = gawindow.GAWindow()
        gaWindow.SetFocus()

        app.MainLoop()
        app.Destroy()
#-------------------------------------------#