An agent-based approach for distributed resource allocations