Optimizing coalition formation for tasks with dynamically evolving rewards and nondeterministic action effects