I have an agent population named parcelstationses with population number 3. I am generating demand of the Parcelstation using Event. Please check the image below,
In the Main agent, I want to track the order generated for each Parcelstation. How can I achieve that?
I tried using parcelstationses.get(0).amount;. But since the order generated is of type Order (another agent type). I get the following error,
cannot convert from order to double.
Just track the number of orders?
int
to Main
, called counter
generateDemand
event, add a line main.counter++
To keep full details?
LinkedHashMap<Order, ParcelStation>
named myOrders
with initial value new LinkedHashMap<Order, ParcelStation>()
generateDemand
event, add a line main.myOrders.put(order, center);
In any case, start understanding data types, model hierarchy and how to use access them, see https://anylogic.help/advanced/code/access.html#where-am-i-and-how-do-i-get-to and the help on data types in general