> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# preferAssignment

```ts theme={null}
function preferAssignment(opts?): RuleEntry<"assignment-priority", object & RuleOptions>;
```

Softly rewards assigning targeted members when they should work if feasible but are not required.

## Parameters

<ResponseField name="opts" type="RuleOptions">
  See [RuleOptions](./RuleOptions)
</ResponseField>

## Returns

`RuleEntry`\<`"assignment-priority"`, `object` & [`RuleOptions`](./RuleOptions)>

Soft constraint. The solver adds a bonus for each assignment of the
targeted members, making them more likely to appear on the schedule.
Use `priority` to control preference strength; higher priority means a larger
bonus. This rule remains a preference, so even `"MANDATORY"` priority does not
force an assignment when hard constraints or stronger objectives prevent it.

Opposite of [avoidAssignment](avoidAssignment). Both map to the same underlying
`assignment-priority` rule with different directions.
