package com.hdkj.lt.si.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: LiuAini
 * @Date 2026/7/24 16:52
 */
@Component
@ConfigurationProperties(prefix = "estimation.algorithm")
@Data
public class EstimationAlgorithmProp {
    private Map<String,Object> objectiveWeights;
    private Double penaltyVoltage;
    private Double penaltyLoadRate;
    private Integer maxReturnSchemes;
    private Map<String,Object> constraints;

    // 转成外层完整Map，方便你之前构建RequestMap直接使用
    public Map<String,Object> toAlgorithmConfigMap(){
        Map<String,Object> map = new HashMap<>();
        map.put("objective_weights", objectiveWeights);
        map.put("penalty_voltage", penaltyVoltage);
        map.put("penalty_load_rate", penaltyLoadRate);
        map.put("max_return_schemes", maxReturnSchemes);
        map.put("constraints", constraints);
        return map;
    }
}
