Using Global Objectives To Control Behaviors In Crowds