3

I am working on a simulation of a blood supply chain and created and imported some tables to manage the masterdata of various agent populations like blood processing centres, testing centres, hospitals and so on. These tables contain the name of said agent and the lat/lon coordinates.

These tables are all part of a MySQL database I connected to AnyLogic with its interface and as I said imported these. So far so good, however, when I want to create the agent populations for each database entry and assign the parameters of the agents to the respective fields of the table, AnyLogic cant assign the name (Varchar in MySQL, String in the imported AnyLogic database) to the parameter name of type String of the agent. Any other type works, just Strings are giving me trouble.

Database in AnyLogic
Database in AnyLogic

Agent and parameter
Agent and parameter

Create population from database
Create population from database

As a sidenote, when I copy all of the database contents into Excel and import the Excel sheet it works just fine, it just struggles with imported databases form MySQL but the database in AnyLogic looks exactly the same, no matter the import method.

ridex
  • 31
  • 3
  • It would be *extremely* helpful if you could find an exact error message somewhere (either the command line, or a log file). For example, on Windows the MySql error log might be in `C:\ProgramData\Mysql`, or `C:\Program Files\MySQL\MySQL Server 5.7\data`. Please update your post with the import error message, if you can find it. – FoggyDay Jan 16 '20 at 00:14

1 Answers1

1

Looks like a bug either in the population properties (e.g., the types are compatible, it just thinks they're not), or in the MySQL import (e.g., some special Unicode characters in that column cause the import to give it a weird HSQLDB type which can be setup but not then converted to String --- the AnyLogic DB is a normal HSQLDB database). To rule out the former, try not setting the name parameter in the population properties and then read all the rows at model startup (use the Insert Database Query wizard to help you) and try to assign the name parameter then. (That may also give you a more useful exception/error message...)

(I can't easily set up a MySQL DB to confirm this. It would be worth also trying with a minimal example model with the MySQL table only having that 'string' column, and then sending that to AnyLogic support if the problem persists.)

Stuart Rossiter
  • 2,432
  • 1
  • 17
  • 20