Search code examples
anylogic

How to inject (in a source) multiple agents but with different parameter settings


I am currently building a model on a manufacture process line and I am trying to inject multiple agents in the model in a specific moment. The agents are components and there are different types of it (blades and tower). What I want to implement is for example injecting 6 new agents in the source and then specify that 2 of them are component.type='blade' and 4 of them are component.type='tower'. Is this possible?


Solution

  • Yes, it is possible through Enter block. You can't join it to a Source block (because it acts like a Source block), but for the next block in the sequence. Create programmatically new agents, then send them to the Enter block.

    Component component = new Component (param1, param2,...);
    component.type = 'blade'
    enterComponent.take(component);