geneticengine.problems
Submodules
Attributes
Classes
Represents the Optimization Problem being solved. |
|
SequentialObjectiveProblem is defined by a list of objectives that are intended to be either maximized/minimized in order. |
|
A problem that is characterized by a single value. |
|
Represents the Optimization Problem being solved. |
|
LazyMultiObjectiveProblem is used for problems whose number of objectives is not known a-priori. |
Package Contents
- class geneticengine.problems.Fitness
Bases:
NamedTuple
- maximizing_aggregate: float
- fitness_components: list[float]
- __str__()
- geneticengine.problems.P
- class geneticengine.problems.Problem(fitness_function, minimize, target=None)
Bases:
abc.ABC
,Generic
[P
]Represents the Optimization Problem being solved.
- Parameters:
fitness_function (Callable[[P], list[float]])
minimize (list[bool])
target (Optional[list[float]])
- minimize: list[bool]
- target: list[float] | None
- ff
- key_function(a)
Returns the (maximizing) fitness of the individual as a single float.
- Parameters:
a (Fitness)
- Return type:
float
- abstractmethod is_better(a, b)
Returns whether the first fitness is better than the second.
- number_of_objectives()
- Return type:
int
- class geneticengine.problems.SequentialObjectiveProblem(fitness_function, minimize, target=None)
-
SequentialObjectiveProblem is defined by a list of objectives that are intended to be either maximized/minimized in order.
- Parameters:
fitness_function (Callable[[P], list[float]])
minimize (list[bool])
target (Optional[list[float]])
- class geneticengine.problems.SingleObjectiveProblem(fitness_function, minimize=False, target=None)
Bases:
SequentialObjectiveProblem
[P
]A problem that is characterized by a single value.
- Parameters:
fitness_function (Callable[[P], float])
minimize (bool)
target (Optional[float])
- class geneticengine.problems.MultiObjectiveProblem(fitness_function, minimize, target=None)
-
Represents the Optimization Problem being solved.
- Parameters:
fitness_function (Callable[[P], list[float]])
minimize (list[bool])
target (Optional[list[float]])
- class geneticengine.problems.LazyMultiObjectiveProblem(fitness_function, minimize=False, target=None)
Bases:
MultiObjectiveProblem
LazyMultiObjectiveProblem is used for problems whose number of objectives is not known a-priori.
- Parameters:
fitness_function (Callable[[P], list[float]])
minimize (bool)
target (Optional[float])
- initialized = False
- future_minimize = False
- future_target = None
- number_of_objectives()
- Return type:
int
- geneticengine.problems.__ALL__