private static float UtilityFunc_EmpireProduction(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext) { global::Empire empire = context.Get("Empire") as global::Empire; Diagnostics.Assert(empire != null); float num = Mathf.Max(1f, AILayer_Altar.GetCityPropertySumValue(empire, SimulationProperties.NetCityProduction)); float utility = aiParameterValue / num; return(AILayer_Altar.Normalize(debugContext, 0f, 0.7f, utility)); }
private static float UtilityFunc_EmpireCityDefense(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext) { global::Empire empire = context.Get("Empire") as global::Empire; Diagnostics.Assert(empire != null); DepartmentOfTheInterior agency = empire.GetAgency <DepartmentOfTheInterior>(); Diagnostics.Assert(agency != null); float num = Mathf.Max(1f, AILayer_Altar.GetCityPropertySumValue(empire, SimulationProperties.CityDefensePoint)) / (float)agency.Cities.Count; if (float.IsNaN(num)) { return(0f); } float utility = aiParameterValue / num; return(AILayer_Altar.Normalize(debugContext, 0f, 3f, utility)); }