within an AnyLogic project, in the 'seize' block I need to make a custom choice of resources from resource sets.
Having in the properties tab of the 'seize' block the field "Resource sets" with the value { {ResourcePool_A, ResourcePool_B} }
and the flag "customize resource choice" checked. In the "resource choice condition" code section, I need to make a choice like:
if (unit isfrom ResourcePool_A)
{
if (unit.param_a == value)
do something
....
}
else if (unit isfrom ResourcePool_B)
{
if (unit.param_b == value)
do something
....
}
How can I check if a resource unit is from a given pool or not and then discriminate resources accordingly with their features? Thank you. Best regards.
I solved the issue writing a an Anylogic function that returns a boolean and I used it in the resource choice condition. I implemented "isfrom" to discriminate from which pools the resource is picked up as shown in following code:
`
`
In the Anylogic documentation is not explained that in the resource choice condition of the seize block you have access also to the
pool
object (this is bad...).