Search code examples
anylogic

Select Parking Lot based on free space in Road Traffic Library of Anylogic


I have two ParkingLot namely parkinglot1 and parkinglot2. Please refer to the image below

enter image description here

I have used a collection namely (parkingSpaces). And in the carSource block I am using the following to select the parkinglot with free space available. Please see image below,

enter image description here

But this is not working.


Solution

  • instead do this:

    findFirst(parkingSpaces,p->p.nFree()>0)