private float EvaluateBindingsUtility(WorldModel context, List <ActionInstance> possibleBindingsinstances) { float total = 0.0f; for (int i = 0; i < possibleBindingsinstances.Count; i++) { ActionInstance binding = possibleBindingsinstances[i]; var newModel = binding.VirtualRun(context); float Utility = 0.0f; foreach (var goal in m_goals) { Utility += goal.getProgress(context, newModel) * goal.importance; } total += Utility; } return(total); }