[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/api/assign/pool/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Pool

The workers that [`SkillLayer.Slots`](<https://docs.dhtmlx.com/planning-engine/net/api/skill-layer-slots.md>) may put on tasks, each a project resource with its skills. Create one with an object initializer and pass it to `SkillLayer.Slots` together with the requirements. Part of the [`Plen.Assign`](<https://docs.dhtmlx.com/planning-engine/net/api/assign/overview.md>) package.

## Declaration

```csharp
namespace Plen.Assign;

public sealed class Pool : IDeepCloneable<Pool>, IEquatable<Pool>
```

## Constructors

### Pool()

```csharp
public Pool()
```

Creates an empty pool. Set `Workers` in an object initializer.

## Properties

| Property | Type | Default | Description |
|---|---|---|---|
| `Workers` | `List<`[`Worker`](<https://docs.dhtmlx.com/planning-engine/net/api/assign/worker.md>)`>` | empty | The workers, in preference order. A worker earlier in the list wins a tie between equally scored candidates. |

Each worker must name a resource of the project, and a resource can appear only once. [`SkillLayer.Slots`](<https://docs.dhtmlx.com/planning-engine/net/api/skill-layer-slots.md>) checks this and throws [`InputException`](<https://docs.dhtmlx.com/planning-engine/net/api/core/errors/input-exception.md>) with a `pool.workers[i]…` path; see [Errors](<https://docs.dhtmlx.com/planning-engine/net/api/skill-layer-slots.md#errors>).

## Methods

### DeepClone

```csharp
public Pool DeepClone()
```

Returns a deep copy. The `Workers` list and every [`Worker`](<https://docs.dhtmlx.com/planning-engine/net/api/assign/worker.md>) in it are copied, so nothing is shared with the original.

### Equals

```csharp
public bool Equals(Pool? other)
public override bool Equals(object? obj)
```

Two pools are equal when `Workers` holds equal workers in the same order.

`GetHashCode()` follows the same rule.

### ToString

```csharp
public override string ToString()
```

Returns a readable rendering of the workers, for logging.

## Example

Three workers. `ann` comes first, so she's preferred over `bob` when both fit a slot equally well.

```csharp
using Plen;
using Plen.Assign;

var pool = new Pool
{
    Workers =
    [
        new Worker { Resource = "ann", Skills = [new Skill { Id = "backend", Value = 3 }] },
        new Worker { Resource = "bob", Skills = [new Skill { Id = "backend", Value = 2 }, new Skill { Id = "frontend" }] },
        new Worker { Resource = "cid", Skills = [new Skill { Id = "frontend" }] },
    ],
};

Console.WriteLine(pool.Workers.Count); // 3
```

## Related

- [`SkillLayer.Slots`](<https://docs.dhtmlx.com/planning-engine/net/api/skill-layer-slots.md>) - the call that reads the pool
- [`Worker`](<https://docs.dhtmlx.com/planning-engine/net/api/assign/worker.md>) - one entry of the pool
- [`Requirement`](<https://docs.dhtmlx.com/planning-engine/net/api/assign/requirement.md>) - what each task needs from the pool
- [`Slot`](<https://docs.dhtmlx.com/planning-engine/net/api/core/suggest/slot.md>) - the slots built from the pool's workers
- [Skills and requirements](<https://docs.dhtmlx.com/planning-engine/net/resources-and-assignment/skills-and-requirements.md>) - staffing tasks by skill
