Skip to main content

Agent

Module: opytimizer.core.agent

An Agent class for all optimization techniques.

Constructor​

Agent(n_variables: int, n_dimensions: int, n_objectives: int, lower_bound: List[Union[int, float]], upper_bound: List[Union[int, float]], mapping: Optional[List[str]] = None, env: opytimizer.core.environment.Environment = None) -> None

Parameters​

ParameterTypeDefaultDescription
n_variablesint—
n_dimensionsint—
n_objectivesint—
lower_boundList[Union[int, float]]—
upper_boundList[Union[int, float]]—
mappingOptional[List[str]]None—
envopytimizer.core.environment.EnvironmentNone—

Methods​

clip_by_bound​

clip_by_bound(self) -> None

Clips the agent's decision variables to the bounds limits.

dominates​

dominates(self, other: 'Agent') -> bool

Checks if this agent dominates another agent.

Returns: (bool): Whether this agent dominates the other.

Parameters​

ParameterTypeDefaultDescription
otherAgentAnother agent to be compared.

fill_with_binary​

fill_with_binary(self) -> None

Fills the agent's decision variables with a binary distribution.

fill_with_static​

fill_with_static(self, values: numpy.ndarray) -> None

Fills the agent's decision variables with static values. Note that this method ignore the agent's bounds, so use it carefully.

Parameters​

ParameterTypeDefaultDescription
valuesnumpy.ndarrayValues to be filled (expected shape (n_variables,)).

fill_with_uniform​

fill_with_uniform(self) -> None

Fills the agent's decision variables with a uniform distribution based on bounds limits.