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_variablesintNumber of decision variables.
n_dimensionsintNumber of dimensions.
n_objectivesintNumber of objective functions.
lower_boundList[Union[int, float]]Minimum possible values.
upper_boundList[Union[int, float]]Maximum possible values.
mappingOptional[List[str]]NoneString-based identifiers for mapping variables' names.`
envopytimizer.core.environment.EnvironmentNoneEnvironment class object.

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.