jijzepttools.blackbox_optimization.benchmark.problem.interface.interface#
Classes#
ベンチマーク関数の基底クラス |
Module Contents#
- class VariableInfo#
- name: str#
- kind: Literal['binary', 'integer', 'continuous']#
- lower: float#
- upper: float#
- class BlackboxFunction#
Bases:
abc.ABC
ベンチマーク関数の基底クラス
すべてのベンチマーク関数は以下のメソッドを実装する必要があります: - evaluate: 関数値を計算 - create_random_points: ランダムな点を作成 - _create_name: 関数名を作成 - _create_variable_info: 変数情報を作成
プロパティ: - name: 関数名を返す - variable_info: 変数情報を返す
- abstract evaluate(var_as_dict: dict[str, int | float]) float #
関数値を計算する抽象メソッド 変数名はvariable_infoで取得できる
- Parameters:
var_as_dict – 評価する点の座標(辞書形式) key: 変数名 value: 変数の値
- Returns:
関数値
- Return type:
float
- property name: str#
ベンチマーク関数の名前
- create_random_points(n_points: int) tuple[list[dict[str, int | float]], list[float]] #
ランダムな点を作成するメソッド
- Parameters:
n_points – 作成する点の数
- Returns:
- (x_init, y_init)
x_initの要素はkeyがvariable_infoのname, valueがvariable_infoのlowerからupperの間のランダムな値
- Return type:
tuple[list[dict[str, int | float]], list[float]]
- property variable_info: dict[str, VariableInfo]#
変数情報