vsTASKER 7 Tutorial
×
Menu
Index

Simple Test

 
Open the scenario SQL/test_mysql or SQL/test_sqlite as the two databases are similar but are running with different SQL servers and API.
 
All tables are located in the Schema SQL.
Open MySQL Workbench, connect to the database and import the test_mysql.sql auto-extract dump from /Runtime/SQL/mySQL directory
You can check in Workbench that the entity table contains the following data.
 
 
Recompile the simulation engine and start it. You will see the four entities being created at the specified coordinates (from the table) and start moving towards their named locations, with the given speed.
 
 
The Open mode SQL Tables are automatically loaded by the simulation engine and the content is stored into a code generated data structure, matching the row definitions of the Table.
In this example, the initial table has generated a class Initial accessible using the structure named db_sql. The Initial class has all column values as members, with the same name. You can see how the Player extracts the entities from the table Initial and create them. Logic: CreateEntities
 
Later, each entity will write specific data into the table Result using a simple SQL command: Action StoreDb in WhereToGo Logic.
 
At the end of the simulation, the result table can be parsed (from the Workbench) to see the values written by the simulation engine during the play.