示例#1
0
    private static float UtilityFunc_EmpirePoint(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, empire.GetPropertyValue(SimulationProperties.NetEmpirePoint));
        float utility = aiParameterValue / num;

        return(AILayer_Altar.Normalize(debugContext, 0.5f, 4f, utility));
    }
示例#2
0
    private static float UtilityFunc_EmpireResearch(SeasonEffect aiEvaluableElement, InterpreterContext context, float aiParameterValue, AIHeuristicAnalyser.Context debugContext)
    {
        global::Empire empire = context.Get("Empire") as global::Empire;

        Diagnostics.Assert(empire != null);
        if (empire.SimulationObject.Tags.Contains("AffinityReplicants"))
        {
            return(0f);
        }
        float num     = Mathf.Max(1f, empire.GetPropertyValue(SimulationProperties.NetEmpireResearch));
        float utility = aiParameterValue / num;

        return(AILayer_Altar.Normalize(debugContext, 0f, 1.7f, utility));
    }
示例#3
0
    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));
    }