![]() This rule is also applicable for final collections that accept the entire column as a list. In this case, you may ask the database for value. It can be a statechart transition timeout. Sometimes it is not necessary to create a parameter for a particular value, e.g. Here you may specify the value using the graphical interface: select the table, the value column and write the simple boolean expression that matches the condition.Įxperienced users may write the query code directly. Click the blue sign of equality for enabling the database reference mode. Most objects support a database model - they will be initialized using the query. ![]() Once all tables are created, right-click at the table, select new agent type, and the wizard will display the column names as agent type parameter names, and the table name as agent type name. Enhance visualization of this process by using the database tables. When you develop an agent-based model, firstly you plan how to model its actors - agents, and structure of their interaction. In this case, you can add the GIS location name parameter as a second parameter, map it with the same column, and an agent will be located at the respective city automatically! Search for the name at the GIS map, and the most relevant result will be applied. Sometimes one parameter may represent several characteristics, e.g., agent name matches with the agent location (say, a city). Now, the population may be initialized in two clicks, through mapping the column name with the parameter name. It is a tough task, especially when the file should feed the population.īuilt-in database dramatically simplifies this process, allowing to remove completely the dozens or even hundreds of lines of code. The Excel file connectivity tool supports only code mode, forcing the user to learn Java, painstakingly match the row/column indexes, and rewrite the code following a change to an Excel table. They are available in AnyLogic example models: Help – Example Models – How-To models – Database Connectivity.Īdvantages of new way to load data into the model The best way to start learning built-in database is to look at How-To models. It allows to get the specified value, import the table column as a list, iterate over the column elements, etc. For users, which do not know SQL, we provide a Query Constructor (a wizard that generates the required code depending on user input). Here is the example for source block that allows to use a database table as arrival table.Īlso, there is a possibility to write the query code. Most objects support the graphical interface, from usual parameter to flowchart blocks. E.g., if you need to feed a population from a database or define arrival table at Source block, just use the graphical interface of object properties. We provide an intuitive interface for most common use cases, so the modeler dows not have to write SQL queries. So, the database may be accessed by SQL commands or Query DSL Java code. If the "Update data." checkbox is selected, then all changes to the source will be applied to the database.īefore starting to explore the database capabilities, let's look how we may interact with the database from the model canvas. Also, data can be simply copy-pasted from Excel to the table (and vice-versa). ![]() The database allows to import data from Excel file, Access or SQL database - just click "Create or import a table." text at database properties or the right-click context menu. The filling process is clear and simple no need for coding. Import of initial data to the built-in database is an easy task. Also, at the end of this post you may find some tips for work with the database, and a brief description of further enhancements.Ĭonvenient access to database and one-click automatic import of data At last, it stores the simulation statistics, simplifying the data post-processing and export.Įach of these advantages has many use cases, let's see each one in details.It may act as an information dealer for agents, simplifying the algorithms, encapsulating the data and serving as a unified data source for parametrized variables.It is a useful instrument for visualization of agent type hierarchy and development of the data model.The database is now available in all editions, including free AnyLogic Personal Learning Edition. ![]()
0 Comments
Leave a Reply. |