package com.gyee.generation.util.math;

public class AvailablePowerAccuracyCalculator {
    public static void main(String[] args) {
        // 输入数据
        double actualGeneration = 0; /* 当日新能源场站非限电时段实际发电量 */
        ;
        double availablePower = 0; /* 当日新能源场站非限电时段可用电量 */
        ;
        double installedCapacity = 0;/* 全场装机容量 */
        ;

        // 计算日准确率
        double accuracy = calculateAccuracy(actualGeneration, availablePower);

        // 输出结果
        System.out.println("可用电量的日准确率: " + accuracy + "%");

        // 计算考核分数
        double score = calculateAssessmentScore(accuracy, installedCapacity);

        // 输出考核分数
        System.out.println("考核分数: " + score + "分/万千瓦");
    }

    public static double calculateAccuracy(double actualGeneration, double availablePower) {
        if (actualGeneration == 0) {
            return 100.0; // 不考核
        } else {
            double accuracy = (actualGeneration - availablePower) / actualGeneration * 100;
            return accuracy;
        }
    }

    public static double calculateAssessmentScore(double accuracy, double installedCapacity) {
        if (accuracy >= 97) {
            return 0.0; // 准确率达标，不需要考核
        } else {
            double score = (97 - accuracy) * installedCapacity * 0.05;
            return score;
        }
    }
}