Search code examples
anylogic

Refer to transporter in flowchart blocks ANYLOGIC


In my model sometimes my transporter (agent type=AMR) needs to charge his battery, this is executed by creating a new order in the source block and let them seize the specific transporter to a certain location where this transporter gets charged. This charging is happening in a delay block, so when for example my transporter with the charging order leaves this block I want my transporter parameter of the battery level been set to 100 I already tried a few option such as (AMR)unit).Batterylevel=100, but in the delay block I'm only able to links some actions on exit on the order and not the transporter, but I want to change the transporter parameters in the on exit block but how do I code this?. (see figures below for perhaps a better understanding)

enter image description here

enter image description here


Solution

  • Instead of trying to do this in the delay block, I recommend you do that in the release block since no model time would have passed between the two blocks, so the model logic would not be impacted.

    In the on enter field of the release block use:

    ((AMR)unit).Batterylevel=100