pg.geno.Float

Accessible via pg.geno.Float.

class Float(min_value, max_value, scale=None, hints=None, location=, name=None)[source]

Bases: pg.geno.DecisionPoint

Represents the genotype for a float-value genome.

Example:

# Create a float decision point within range [0.1, 1.0].
decision_point = pg.geno.floatv(0.1, 1.0)

See also: pg.geno.floatv.

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.

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.

validate(dna)[source]

Validate whether a DNA value conforms to this spec.

Return type:

None