I have a transporter type agent called Truck. Its population called truck. I added a TransporterFleet block to the model which is called truckFleet. In truckFleet I selected Truck for both New Transporter and Transporter Type sections. An agent called trench seizes from truckfleet and when it release the truck, it will allocate a value to a variable as I used ((Truck)unit).v_capacityFull = true;
in the on release transporter section.
Now I have another agent called dumping. Now this agent needs to sieze a specefic truck from truckFleet. one that has the following value v_capacityFull == true.
So I have been applying two approaches:
new truckFleet = List filter(truck, t -> v_capacity == 0);
new truckFleet = List filter(truck, t -> v_capacity == 0);
but in the transporter type I still used Truck.for the first approach: I get the following errors:
and for the second option: I get the following errors:
In general, I am not happy about non of them but could not think about another approach. And I am not just interested to resolve errors but to find an approach that fulfill my intentions.
The answer is very easy actually. I can use the same truckFleet but in the Advanced section of the SeizeTransporter block, in Transporter choice condition section, I can type ((Truck)unit).v_capacityFull == true
. :)