
class ScarcityMultiplierC3Calculator:
    """稀缺性乘数C3计算器"""
    
    def __init__(self):
        """初始化计算器"""
        pass
    
    def calculate_scarcity_multiplier_c3(self, issuance_level: str) -> float:
        """
        计算稀缺性乘数C3
        
        
        稀缺性乘数C3 = 1 + 稀缺等级分
        
        args:
            issuance_level: 资产发行等级 (用户选择)
            
        Returns:
            float: 稀缺性乘数C3
        """
        # 计算稀缺等级分
        scarcity_level_score = self.calculate_scarcity_level_score(issuance_level)
        
        
        scarcity_multiplier = 1 + scarcity_level_score
        
        return scarcity_multiplier
    
    def calculate_scarcity_level_score(self, issuance_level: str) -> float:
        """
        计算稀缺等级分

        根据用户所选择的资产发行量匹配稀缺等级：
        孤品 全球唯一，不可复制（如特定版权、唯一实物） 1.0
        限量 总发行份数 ≤ 100份 0.7
        稀有 总发行份数 ∈ (100, 1000]份，或二级市场流通率 < 5% 0.4
        流通 总发行份数 > 1000份，或二级市场流通率 ≥ 5% 0.1

        
        args:
            issuance_level: 资产发行等级 (用户选择)
            
        Returns:
            float: 稀缺等级分
        """
        scarcity_scores = {
            "孤品": 1.0,
            "限量": 0.7,
            "稀有": 0.4,
            "流通": 0.1
        }
        for s_key,s_value in scarcity_scores.items():
            if s_key in issuance_level:
                return s_value
        
        return 0.1


# 示例使用
if __name__ == "__main__":
    # 创建计算器实例
    calculator = ScarcityMultiplierC3Calculator()
    
    # 示例数据
    issuance_level = "限量"  # 资产发行等级 (用户选择)
    
    # 计算稀缺性乘数C3
    scarcity_multiplier_c3 = calculator.calculate_scarcity_multiplier_c3(issuance_level)
    
    print(f"资产发行等级: {issuance_level}")
    print(f"稀缺等级分: {calculator.calculate_scarcity_level_score(issuance_level):.1f}")
    print(f"稀缺性乘数C3: {scarcity_multiplier_c3:.4f}")

