In reply to SharonBeaulah:
The first argument to create() is the instance name. Every child component needs a unique instance name. (Imagine your parents named you and your brother “Chris”!)
Here is how I would write the create loop. Your instance name string does not HAVE to match the handle name, but it makes debug easier. Put the index value in the string with $sformatf().
master_agent agt[num_agent];
foreach (my_master_agent)
agt[i] = master_agent::type_id::create($sformatf("agt[%0d]", i), this);
Now you have instance names “agt[0]”, “agt[1]”, etc. I like to put square brackets around the index to prevent an issue with wildcards. In the uvm_config_db, if you specify “env.agt1*”, that will match “env.agt1”, “env.agt10”, “env.agt11”, etc.