Reputation: 1
I have a Service block which can seize a resource from one of two Resource Pools. At the "On seize unit" section of Actions in that block I'd like to determine which Resource Pool the agent came from.
I tried to create a bespoke agent type for the Resource Pools that could have a variable attached which I could then read via something like "unit.MySpecies" but get the "MySpecies cannot be resolved or is not a field".
My Java/AnyLogic skills are pretty basic, so any help is appreciated. I saw the answer for getting individual resources utilisation, but I'm hoping this question is an order of magnitude simpler and is just a case of the right words and grammar.
Upvotes: 0
Views: 1138
Reputation: 12660
You must use Java properly, the error suggests some wrong format:
unit.myPool
. Maybe you are also writing your code wrong in the on seize. If you want to check where the resource comes from, make sure it looks like:
if (unit.myPool.equals(myResourcePool)...
Where "myResourcePool" is the actual name of the resource pool.
Upvotes: 1