I have three agents: Buyer, Supplier, and Order. Buyers have a 'supplier' parameter. Order has six parameters of varying types, p1,...,p6. I'm using an Event to govern how often a buyer sends an order to a supplier. My action code in that placesOrder Event is:
Order order = new Order(p1, p2, p3, p4, p5, p6);
send(order,supplier);
I get the following error: "Can't instantiate the type Order" in the placesOrder Event. I've used this technique in other simulations but this is the first time I've gotten this error. The java code is basically the same as in other models (different parameters of course). I'm not sure I understand how to begin debugging this one. Any suggestions on where to go from here? Any more info needed?
The error is that you have another generic called Order... so order is a bit of a conflicting name that you shouldn't use if avoidable. Also you have the arguments of your class constructor wrong and they should be like this:
So if you do this, the problem is solved:
logservqual_satisfaction.Order order = new logservqual_satisfaction.Order( 0, 0.0, 0.0, 0.0, supplier,this);
Great spot, thx for raising my error earlier, deleted my reply. I honestly didn't know anymore and always avoid instantiating this way... thx for flagging
Thanks! That helped me fix it. Although, I've used an agent called 'Order' in previous models without any issue...either way, I'm good to go now. Thanks for the help