// Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; using Microsoft.Agents.AI.Workflows.Execution; using AssignerF = System.Func>; namespace Microsoft.Agents.AI.Workflows; /// /// Represents a connection from a single node to a set of nodes, optionally associated with a paritition selector /// function which maps incoming messages to a subset of the target set. /// internal sealed class FanOutEdgeData : EdgeData { internal FanOutEdgeData(string sourceId, List sinkIds, EdgeId edgeId, AssignerF? assigner = null) : base(edgeId) { this.SourceId = sourceId; this.SinkIds = sinkIds; this.EdgeAssigner = assigner; this.Connection = new([sourceId], sinkIds); } /// /// The Id of the source node. /// public string SourceId { get; } /// /// The ordered list of Ids of the destination nodes. /// public List SinkIds { get; } /// /// A function mapping an incoming message to a subset of the target executor nodes (or optionally all of them). /// If , all destination nodes are selected. /// public AssignerF? EdgeAssigner { get; } /// internal override EdgeConnection Connection { get; } }