How to do multiple instance of same agent?

In reply to dave_59:

Thank you for your valuable response. but your code is only work out for gen_if intf [4]; if i use gen_if ch_if(); parallely its not working.