question

Preet avatar image
0 Likes"
Preet asked Jeanette F commented

Auto add new techs in agent systems

Hello!

I am sharing a demo model here which is a mini version of my bigger model.

I have operators (tech) who are connected to dispatcher. They are used to fix the fault on processors. I have a safety system in place where if they come into the proximity of processors, that processor will stop until the tech is inside the radius. Eventually, I am going to run my actual simulation with different options of operators which are controlled via parameter.

I noticed that on model reset, the copies of tech is created but not all of them automatically added to agent system. Only 1 tech gets added. How would I do that? They do get added to the tech group and connected to the dispatcher. Only not added to agent system.

demo_model_3.fsm

1677628503150.png

FlexSim 23.0.2
agent system with parameter
1677628503150.png (223.3 KiB)
demo-model-3.fsm (109.1 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Preet, was Jeanette F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jeanette F avatar image
0 Likes"
Jeanette F answered Jeanette F commented

Hello @Preet,

I added some code to the On Set trigger for the parameter. Line 27 creates all the connection and adds the new operators to the groups that the original operator had. After that line I added in basically the same code that is in the create agent and activate agent behavior picklist options in the custom code activity.

1677642975494.png

1677642959009.png

demo-model-3_1.fsm


1677642959009.png (11.7 KiB)
1677642975494.png (80.4 KiB)
demo-model-3-1.fsm (64.8 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Preet avatar image Preet commented ·

Hi @Jeanette F. Thank you very much. This is exactly what I am looking for. ONe more question. How would I make default behavior off for these new agents?

1677687497911.png

0 Likes 0 ·
1677687497911.png (65.9 KiB)
Jeanette F avatar image Jeanette F ♦♦ Preet commented ·

Hello @Preet,

You will need to add in something that on model start the operators have their behavior turned off. I have not been successful in getting the behavior to turn off before the model run.

demo-model-3_2.fsm

0 Likes 0 ·
demo-model-3-2.fsm (60.8 KiB)