Gina Salmins
Gina Salmins

Reputation: 1

anylogic error: Not unqiue database value

In an Anylogic discrete event model, I am trying to set an arrival rate and how many agents per arrival based on a database table I created. The table includes a column for the date and time a material came in, and then a unique code and order number that is assigned to each material. There is only one code per material but several order numbers assigned for each day it is received. Also, multiple materials are received each day at the same time. When I set up the Source to read data from the table, I get an error at runtime saying: Error during model creation: image description here root: Not unique database value!

I cannot find any help on Anylogic that addresses this error.

Upvotes: 0

Views: 2037

Answers (1)

Gianna
Gianna

Reputation: 1

I asked the same question the Any Logic Support Team and got the following answer.

The parameter "Arrival date" requires to specify the table column that contains arrival dates. Then, a "Source" block will read that the table with the column row by row and generate one agent on the date from current row. When you specify a database reference with a specific condition, the "Source" block will generate one agent that matches the condition. You gets the error as there are more than one row matching the condition in the table. In order to implement your task, you may create a view based on your table that has the definition similar to the database reference:

SELECT \all the columns you need for your query

tabelle1.all_id, 
tabelle1.date, 
tabelle1.maschine 

FROM \the reference table 

tabelle1 

WHERE \with the WHERE you can specify which rows should generate an agent 

tabelle1.maschine = 'M31'

After that, simply tell the "Source" block to generate agents according arrival dates from the view.

Hope this is also helpful for you.

Upvotes: 0

Related Questions