Developing multi-agent systems with automatic agent generation and dynamic task allocation mechanisms