Optimizing resource constraint problems using agents.