Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Did anyone work with set_center method in AnyLogic?

Tags:

java

anylogic

I'm using AnyLogic for a project in Supply Chain. I would love to ask those who have seen the predefined model in AnyLogic.

Its path is in: Welcome > Example Models > Supply Chains and Logistics > Product delivery. In the model they used a function called set_center (You can find it in the Main). You can find below the code in AnyLogic

for (Distributor distributor : distributors) 
    distributor.set_center(
        distributor.getNearestAgentByRoute(manufacturingCenters));

For my project, I created a model inspired from the predefined model described above but the function set_center didn't work. It tells me in the console

The method set_center(shiptopoint.getNearestAgentByRoute(retailers)) is undefined for the type Shiptopoint

Where shiptopoint and retailers are agents that I created for my model (They are both population agents)

I tried to find the Java Code but I didn't find it.
Does anyone have a clue please?

like image 735
Chloe Avatar asked Nov 23 '25 10:11

Chloe


1 Answers

set_center(...) is an automatically created method for the parameter center in the agent type Distributor. Each parameter you create gets such a method, see AnyLogic help on parameters.

You lack a parameter center in your agent type, so there is no such method.

like image 134
Benjamin Avatar answered Nov 24 '25 23:11

Benjamin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!