-
Notifications
You must be signed in to change notification settings - Fork 29
Database Connection
Kakali Basak edited this page Jul 17, 2019
·
8 revisions
SimMobility uses open source database PostgreSQL. It is better to install the database in the same server where the simulation will run if it is a large simulation otherwise network delay may cause slower simulation time. SimMobility is distributed with demo data which should be restored and connect with SimMobility code. If the simulation need to run for a new city then need to create a new database and populate the necessary data for the simulation.
Check postgresql download and for front-end pgAdmin
For more information about the SimMobility database schema and functions click here
Steps to create and connect to a new SimMobility Virtual City database:
- Download and instal PostgreSQL database (its a free software) into your server
- Restore the database from the backup provided.
- Create new empty DB (i.e. simmobcity) from pgAdmin
- At the command prompt, navigation to the folder containing the downloaded demo data.
- Run the following command
i.e.pg_restore -U postgres -h localhost -O -x <demo_data_filename> -d <new_DB_name>
pg_restore -U postgres -h localhost -O -x simmobcity.archive.20190123 -d simmobcity
- Configure XML file
Database connection is defined in the
simulation.xml
file
<database id="fm_remote" dbtype="postgres">
<host value="xxx.xx.xxx.xx"/>
<port value="5432"/>
<dbname value="simmobcity"/>
<plaintext-credential id="fm_remote_plain">
<username value="postgres"/>
<password value="xxxxxx"/>
</plaintext-credential>
- Configure
simrun_MidTerm.xml
with the relevant information
<network_database database="fm_remote" credentials="fm_remote_plain" proc_map="simmobcity"/>
proc_map
is defined in simrun_MidTerm.xml
to list the functions