Modeling human-robots teams to optimize their safety