0
votes

I have an assembler that acts as synchronization point in my network. It receives two different objects and in the "OnEnterDelay" event of this block I would like that the building of the output object starting only if I have a particular value inside the input objects.

I managed the check but I don't know how to discard the input if this condition is not matched and I tried to only remove agents from the input queues but it seems to not working

SupplierInfo supplierInfo = (SupplierInfo)self.queueGet(2, 0);

if (!supplierInfo.getStatus())
{
    self.queue1.removeFirst();
    self.queue2.removeFirst();
}
1
Have you checked if when the action "On Enter Delay" occurs there are elements in queue. The assembler block consumes the inputs when it is producing the output, so it might have already consumed the products in queue.luizfvpereira

1 Answers

2
votes

maybe you need to send the discarded objects somewhere. you could connect an enter-object to a sink, and then use:
enter.take(self.queue1.removeFirst)

if that doesn't work, you could create the check before the assembler and remove them before they enter the assembler.