0

I can't solve this Error: Description: The constructor Request(int, Suppliers) is undefined. Location: testing/Suppliers/requestSupplier - Event

This is the Code:

Request request = new Request(uniform_discr(10,20), this);
Vehicle truck = getNearestAgentByRoute(filter(main.vehicles,
                v -> v.inState(Vehicle.AtFactory)));
if (truck != null)
send (request, truck);

Screenshot Error

1 Answers1

0

You should not instantiate agents this way (like Java classes). Always add them to an agent population using add_MyRequestPopulation(...) where the args are your agent parameters

So create an population of Requests and use the code above. Note that you need to specify all 4 parameters of your Request agent type

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Thanks, I did it, But I have a question, I would like to build a supply chain model and using Blockchain library (web3j library) an import it to Anylogic to make the data storage on a Blockchain environment, do you know how can I do it ? – Mnasri Souhail May 04 '22 at 02:26
  • Happy to help but please always open new issues for new questions, SOF does not work like a chat. See https://www.benjamin-schumann.com/blog/2021/4/1/how-to-win-at-anylogic-on-stackoverflow – Benjamin May 04 '22 at 05:10
  • I create a question here : https://stackoverflow.com/questions/72114383/how-to-use-and-import-blockchain-library-web3j-on-anylogic – Mnasri Souhail May 04 '22 at 17:43