コード例 #1
0
ファイル: demo.py プロジェクト: christianurich/VIBe2UrbanSim
    db.commit()
    dbc.close()
    db.close()


if __name__ == '__main__':

    start = time.clock()
    ti = time.clock()
    db = MySQLdb.connect(host = 'localhost', user = '******', passwd = '1234', db = 'ncpopsyn')
    dbc = db.cursor()
#______________________________________________________________________
#Reading the Index Matrix
    dbc.execute("select * from index_matrix_%s"%(0))
    result = dbc.fetchall()
    index_matrix = numpy.asarray(result)
#______________________________________________________________________
# Creating person index_matrix
    p_index_matrix = drawing_households.person_index_matrix(db)
#______________________________________________________________________
# This is the serial implementation of the code

    geography = (2702, 52900, 4)
    configure_and_run(index_matrix, p_index_matrix, geography)
    print 'Synthesis for the geography was completed in %.2f' %(time.clock()-ti)


    dbc.close()
    db.commit()
    db.close()
コード例 #2
0

if __name__ == '__main__':

    start = time.clock()
    ti = time.clock()
    db = MySQLdb.connect(host='localhost',
                         user='******',
                         passwd='1234',
                         db='ncpopsyn')
    dbc = db.cursor()
    #______________________________________________________________________
    #Reading the Index Matrix
    dbc.execute("select * from index_matrix_%s" % (0))
    result = dbc.fetchall()
    index_matrix = numpy.asarray(result)
    #______________________________________________________________________
    # Creating person index_matrix
    p_index_matrix = drawing_households.person_index_matrix(db)
    #______________________________________________________________________
    # This is the serial implementation of the code

    geography = (2702, 52900, 4)
    configure_and_run(index_matrix, p_index_matrix, geography)
    print 'Synthesis for the geography was completed in %.2f' % (time.clock() -
                                                                 ti)

    dbc.close()
    db.commit()
    db.close()