Skip to content

valuation

BlockModelEvaluator

二次封装块段模型评估与储量计算相关函数 提供距离幂估值、克里格估值、储量计算等功能

Source code in dimine_python_sdk\lib\prospecting\valuation.py
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
class BlockModelEvaluator:
    """
    二次封装块段模型评估与储量计算相关函数
    提供距离幂估值、克里格估值、储量计算等功能
    """

    @staticmethod
    def distance_power_evaluation(
        block_model_file: str,
        constraint_params: BlockModelConstraint,
        evaluation_params: BlockModelDistancePowerParams,
        overwrite_result: bool = True
    ) -> Tuple[bool, str]:
        """
        距离幂估值计算
        :param block_model_file: 块段模型文件路径
        :param constraint_params: 约束条件参数(字典)
        :param evaluation_params: 估值计算参数(字典)
        :param overwrite_result: 是否覆盖已有结果
        :return: (是否成功, 结果信息)

        example:
        ```python
        success, message = BlockModelEvaluator.distance_power_evaluation(
            "model.dmf",
            constraint_params,
            evaluation_params
        )
        ```
        """
        # 将参数序列化为JSON字符串
        constraint_json = json.dumps(constraint_params.to_dict(), ensure_ascii=False)
        evaluation_json = json.dumps(evaluation_params.to_dict(), ensure_ascii=False)

        b_res, message = Dm.DistancePowerEvaluationValue(
            block_model_file,
            constraint_json,
            evaluation_json,
            overwrite_result
        )
        return b_res, message

    @staticmethod
    def kriging_evaluation(
        block_model_file: str,
        constraint_params: BlockModelConstraint,
        evaluation_params: BlockModelKrigingParams,
        overwrite_result: bool = True
    ) -> Tuple[bool, str]:
        """
        克里格估值计算
        :param block_model_file: 块段模型文件路径
        :param constraint_params: 约束条件参数
        :param evaluation_params: 估值计算参数
        :param overwrite_result: 是否覆盖已有结果
        :return: (是否成功, 结果信息)

        example:
        ```python
        success, message = BlockModelEvaluator.kriging_evaluation(
            "model.dmf",
            constraint_params,
            evaluation_params
        )
        ```
        """
        constraint_json = json.dumps(constraint_params.to_dict(), ensure_ascii=False)
        evaluation_json = json.dumps(evaluation_params.to_dict(), ensure_ascii=False)
        b_res, message = Dm.KrigEvaluationValue(
            block_model_file,
            constraint_json,
            evaluation_json,
            overwrite_result
        )
        return b_res, message

    @staticmethod
    def calculate_reserves(
        block_model_file: str,
        constraint_params: BlockModelConstraint,
        reserve_params: ReservesCalculateParam
    ) -> Tuple[bool, str]:
        """
        储量计算
        :param block_model_file: 块段模型文件路径
        :param constraint_params: 约束条件参数(字典)
        :param reserve_params: 储量计算参数(字典)
        :return: (是否成功, 结果信息)

        example:
        ```python
        success, message = BlockModelEvaluator.calculate_reserves(
            "model.dmf",
            constraint_params,
            reserve_params
        )
        ```
        """
        constraint_json = json.dumps(constraint_params.to_dict(), ensure_ascii=False)
        reserve_json = json.dumps(reserve_params.to_dict(), ensure_ascii=False)

        b_res, message = Dm.ReservesCalculate(
            block_model_file,
            constraint_json,
            reserve_json
        )
        return b_res, message

calculate_reserves(block_model_file, constraint_params, reserve_params) staticmethod

储量计算 :param block_model_file: 块段模型文件路径 :param constraint_params: 约束条件参数(字典) :param reserve_params: 储量计算参数(字典) :return: (是否成功, 结果信息)

example:

success, message = BlockModelEvaluator.calculate_reserves(
    "model.dmf",
    constraint_params,
    reserve_params
)
Source code in dimine_python_sdk\lib\prospecting\valuation.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@staticmethod
def calculate_reserves(
    block_model_file: str,
    constraint_params: BlockModelConstraint,
    reserve_params: ReservesCalculateParam
) -> Tuple[bool, str]:
    """
    储量计算
    :param block_model_file: 块段模型文件路径
    :param constraint_params: 约束条件参数(字典)
    :param reserve_params: 储量计算参数(字典)
    :return: (是否成功, 结果信息)

    example:
    ```python
    success, message = BlockModelEvaluator.calculate_reserves(
        "model.dmf",
        constraint_params,
        reserve_params
    )
    ```
    """
    constraint_json = json.dumps(constraint_params.to_dict(), ensure_ascii=False)
    reserve_json = json.dumps(reserve_params.to_dict(), ensure_ascii=False)

    b_res, message = Dm.ReservesCalculate(
        block_model_file,
        constraint_json,
        reserve_json
    )
    return b_res, message

distance_power_evaluation(block_model_file, constraint_params, evaluation_params, overwrite_result=True) staticmethod

距离幂估值计算 :param block_model_file: 块段模型文件路径 :param constraint_params: 约束条件参数(字典) :param evaluation_params: 估值计算参数(字典) :param overwrite_result: 是否覆盖已有结果 :return: (是否成功, 结果信息)

example:

success, message = BlockModelEvaluator.distance_power_evaluation(
    "model.dmf",
    constraint_params,
    evaluation_params
)
Source code in dimine_python_sdk\lib\prospecting\valuation.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@staticmethod
def distance_power_evaluation(
    block_model_file: str,
    constraint_params: BlockModelConstraint,
    evaluation_params: BlockModelDistancePowerParams,
    overwrite_result: bool = True
) -> Tuple[bool, str]:
    """
    距离幂估值计算
    :param block_model_file: 块段模型文件路径
    :param constraint_params: 约束条件参数(字典)
    :param evaluation_params: 估值计算参数(字典)
    :param overwrite_result: 是否覆盖已有结果
    :return: (是否成功, 结果信息)

    example:
    ```python
    success, message = BlockModelEvaluator.distance_power_evaluation(
        "model.dmf",
        constraint_params,
        evaluation_params
    )
    ```
    """
    # 将参数序列化为JSON字符串
    constraint_json = json.dumps(constraint_params.to_dict(), ensure_ascii=False)
    evaluation_json = json.dumps(evaluation_params.to_dict(), ensure_ascii=False)

    b_res, message = Dm.DistancePowerEvaluationValue(
        block_model_file,
        constraint_json,
        evaluation_json,
        overwrite_result
    )
    return b_res, message

kriging_evaluation(block_model_file, constraint_params, evaluation_params, overwrite_result=True) staticmethod

克里格估值计算 :param block_model_file: 块段模型文件路径 :param constraint_params: 约束条件参数 :param evaluation_params: 估值计算参数 :param overwrite_result: 是否覆盖已有结果 :return: (是否成功, 结果信息)

example:

success, message = BlockModelEvaluator.kriging_evaluation(
    "model.dmf",
    constraint_params,
    evaluation_params
)
Source code in dimine_python_sdk\lib\prospecting\valuation.py
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@staticmethod
def kriging_evaluation(
    block_model_file: str,
    constraint_params: BlockModelConstraint,
    evaluation_params: BlockModelKrigingParams,
    overwrite_result: bool = True
) -> Tuple[bool, str]:
    """
    克里格估值计算
    :param block_model_file: 块段模型文件路径
    :param constraint_params: 约束条件参数
    :param evaluation_params: 估值计算参数
    :param overwrite_result: 是否覆盖已有结果
    :return: (是否成功, 结果信息)

    example:
    ```python
    success, message = BlockModelEvaluator.kriging_evaluation(
        "model.dmf",
        constraint_params,
        evaluation_params
    )
    ```
    """
    constraint_json = json.dumps(constraint_params.to_dict(), ensure_ascii=False)
    evaluation_json = json.dumps(evaluation_params.to_dict(), ensure_ascii=False)
    b_res, message = Dm.KrigEvaluationValue(
        block_model_file,
        constraint_json,
        evaluation_json,
        overwrite_result
    )
    return b_res, message