Consensus Control of Hierarchical Multi-agent Systems with Constant and Time-Varying Delays