FitnessDefinition#

class ansys.hps.client.jms.FitnessDefinition(id=<marshmallow.missing>, fitness_term_definitions=<marshmallow.missing>, error_fitness=<marshmallow.missing>, **kwargs)#

Provides the fitness definition resource.

Parameters:
idstr, optional

Unique ID to access the resource, generated internally by the server on creation.

fitness_term_definitions

List of ansys.hps.client.jms.FitnessTermDefinition objects.

error_fitnessfloat

Default fitness value to assign to failed jobs.

Examples

>>> fd = FitnessDefinition(error_fitness=10.0)
>>> fd.add_fitness_term(name="weight", type="design_objective", weighting_factor=1.0,
...         expression="map_design_objective( values['weight'], 7.5, 5.5)")
>>> fd.add_fitness_term(name="torsional_stiffness",
...                     type="target_constraint",
...                     weighting_factor=1.0,
...                     expression="map_target_constraint(
...                         values['torsion_stiffness'],
...                         1313.0,
...                         5.0,
...                         30.0 )"
...                     )

Methods

FitnessDefinition.add_fitness_term(**kwargs)

Add a fitness term easily using a helper function.

FitnessDefinition.declared_fields()

Provides a helper function for retrieving fields to define as class members for an object.

FitnessDefinition.get(key[, default])