pg.geno.CustomDecisionPoint

Accessible via pg.geno.CustomDecisionPoint.

class CustomDecisionPoint(hyper_type=None, next_dna_fn=None, random_dna_fn=None, hints=None, location=, name=None)[source]

Bases: pg.geno.DecisionPoint

Represents a user-defined decision point.

Example:

decision_point = pg.geno.custom()

See also: pg.geno.custom.

Attributes:

decision_points

Returns all decision points in their declaration order.

is_categorical

Returns True if current node is a categorical choice.

is_custom_decision_point

Returns True if current node is a custom decision point.

is_numerical

Returns True if current node is numerical decision.

is_subchoice

Returns True if current node is a subchoice of a multi-choice.

space_size

Returns the size of the search space.

Methods:

format([compact, verbose, root_indent, show_id])

Format this object.

sym_eq(other)

Overrides sym_eq to exclude non-serializable fields.

sym_jsonify(**kwargs)

Overrides sym_jsonify to exclude non-serializable fields.

validate(dna)

Validate whether a DNA value conforms to this spec.

property decision_points: List[DecisionPoint][source]

Returns all decision points in their declaration order.

format(compact=True, verbose=True, root_indent=0, show_id=True, **kwargs)[source]

Format this object.

property is_categorical: bool[source]

Returns True if current node is a categorical choice.

property is_custom_decision_point: bool[source]

Returns True if current node is a custom decision point.

property is_numerical: bool[source]

Returns True if current node is numerical decision.

property is_subchoice: bool[source]

Returns True if current node is a subchoice of a multi-choice.

property space_size: int[source]

Returns the size of the search space. Use -1 for infinity.

sym_eq(other)[source]

Overrides sym_eq to exclude non-serializable fields.

Return type:

bool

sym_jsonify(**kwargs)[source]

Overrides sym_jsonify to exclude non-serializable fields.

Return type:

Union[int, float, bool, str, List[Any], Dict[str, Any]]

validate(dna)[source]

Validate whether a DNA value conforms to this spec.

Return type:

None