How can I create an array of agents of same type?

In reply to chr_sue:

Sure. My code file is very huge, just pasting the related lines…

typedef wali_agent #(
.DATA_WIDTH(WALI_DATA_WIDTH),
.ADDR_WIDTH(WALI_ADDR_WIDTH)
)
wali_agent_t;
wali_agent_t wali [N-1:0]; // N is a parameter

// In build_phase
foreach (wali[i_wali]) begin
wali[i_wali] = wali_agent_t::type_id::create(“wali”,this);
wali[i_wali].set_config(configuration.wali_config[i_wali]);
end