I want to use the split block in a process model in a way such that it creates a copy of the incoming agent with the same parameters.
What I did: declare a function SetupCopy(agent, original) with input parameters agent (which is the copy) and original (which is the incoming agent). The function sets the relevant parameters to agent.someBooleanParameter = original.someBooleanParameter. The function is called in the split block in "On exit copy: SetupCopy(agent, original)".
Problem: after the outCopy port of the split block, I used a selectOutput block with the settings Select true output: if condition is true: agent.someBooleanParameter I want this parameter to be equal to the respective parameter of the original agent. However, the output block always evaluates the parameter to false.
I already tried to get an Output to the console of the parameter by setting On exit(false): System.out.println(agent.someBooleanParameter);
If the original agent's parameter is true, the output on the console is also true although the select block exits through the false port. Very confusing to me. What is my mistake?
Can anyone help me how to set the parameters of the copied instance of the agent and reference the parameter correctly?
Thanks