class PolicyMultiplierB13Calculator:
    """政策乘数B13计算器"""

    def __init__(self):
        """初始化计算器"""
        pass

    def calculate_policy_multiplier_b13(self, policy_compatibility_score: float) -> float:
        """
        计算政策乘数B13
        
        
        政策乘数B13 = 1 + (政策契合度评分P × 0.15)
        
        Args:
            policy_compatibility_score: 政策契合度评分P (系统计算)
            
        returns:
            float: 政策乘数B13
        """
        # 
        policy_multiplier = 1 + (policy_compatibility_score * 0.15)

        return policy_multiplier

    def calculate_policy_compatibility_score(self,
                                             policy_match_score: float,
                                             implementation_stage_score: float,
                                             funding_support_score: float) -> float:
        """
        计算政策契合度评分P
        
        
        政策契合度P = 政策匹配度 × 0.4 + 实施阶段评分 × 0.3 + 资金支持度 × 0.3
        
        Args:
            policy_match_score: 政策匹配度 (系统配置)
            implementation_stage_score: 实施阶段评分 (用户填写)
            funding_support_score: 资金支持度 (用户填写)
            
        returns:
            float: 政策契合度评分P
        """
        # 
        policy_compatibility = (policy_match_score * 0.4 +
                                implementation_stage_score * 0.3 +
                                funding_support_score * 0.3)

        return policy_compatibility

    def calculate_policy_match_score(self, industry: str) -> float:
        """
        计算政策匹配度
        
        系统内根据行业自动匹配政策匹配度
        
        Args:
            industry: 所属行业 (用户填写)
            
        returns:
            float: 政策匹配度
        """

        return 5

    def calculate_implementation_stage_score(self, implementation_stage: str) -> float:
        """
        计算实施阶段评分
        
        用户选择目前资产的实施阶段，成熟应用(10分)、推广阶段(7分)、试点阶段(4分)
        
        Args:
            implementation_stage: 实施阶段 (用户填写)
            
        returns:
            float: 实施阶段评分
        """
        stage_scores = {
            "成熟应用": 10.0,
            "推广阶段": 7.0,
            "试点阶段": 4.0
        }

        return stage_scores.get(implementation_stage, 10.0)

    def calculate_funding_support_score(self, funding_support: str) -> float:
        """
        计算资金支持度
        
        用户选择目前资产的资金支持情况，国家级资助(10分)、省级资助(7分)、无资助(0分)
        
        Args:
            funding_support: 资金支持情况 (用户填写)
            
        returns:
            float: 资金支持度
        """
        funding_scores = {
            "国家级资助": 10.0,
            "省级资助": 7.0,
            "无资助": 0.0
        }

        return funding_scores.get(funding_support, 0.0)


# 示例使用
if __name__ == "__main__":
    # 创建计算器实例
    calculator = PolicyMultiplierB13Calculator()

    # 示例数据
    industry = "文化艺术"  # 所属行业 (用户填写)
    implementation_stage = "成熟应用"  # 实施阶段 (用户填写)
    funding_support = "国家级资助"  # 资金支持 (用户填写)

    # 计算各项指标
    policy_match_score = calculator.calculate_policy_match_score(industry)
    implementation_stage_score = calculator.calculate_implementation_stage_score(implementation_stage)
    funding_support_score = calculator.calculate_funding_support_score(funding_support)

    # 计算政策契合度评分P
    policy_compatibility_score = calculator.calculate_policy_compatibility_score(
        policy_match_score, implementation_stage_score, funding_support_score
    )

    # 计算政策乘数B13
    policy_multiplier = calculator.calculate_policy_multiplier_b13(policy_compatibility_score)

    print(f"政策匹配度: {policy_match_score:.2f}")
    print(f"实施阶段评分: {implementation_stage_score:.2f}")
    print(f"资金支持度: {funding_support_score:.2f}")
    print(f"政策契合度评分P: {policy_compatibility_score:.2f}")
    print(f"政策乘数B13: {policy_multiplier:.4f}")
