Table of Contents

Class Transition

Namespace
AutoGen.Core
Assembly
AutoGen.Core.dll

Represents a transition between two agents.

public class Transition
Inheritance
Transition
Inherited Members

Properties

From

public IAgent From { get; }

Property Value

IAgent

To

public IAgent To { get; }

Property Value

IAgent

Methods

CanTransitionAsync(IEnumerable<IMessage>, CancellationToken)

Check if the transition is allowed.

public Task<bool> CanTransitionAsync(IEnumerable<IMessage> messages, CancellationToken ct = default)

Parameters

messages IEnumerable<IMessage>

messages

ct CancellationToken

Returns

Task<bool>

Create<TFromAgent, TToAgent>(TFromAgent, TToAgent)

Create a new instance of Transition without transition condition check.

public static Transition Create<TFromAgent, TToAgent>(TFromAgent from, TToAgent to) where TFromAgent : IAgent where TToAgent : IAgent

Parameters

from TFromAgent
to TToAgent

Returns

Transition

Transition

Type Parameters

TFromAgent
TToAgent

Create<TFromAgent, TToAgent>(TFromAgent, TToAgent, Func<TFromAgent, TToAgent, IEnumerable<IMessage>, CancellationToken, Task<bool>>)

Create a new instance of Transition with cancellation token.

public static Transition Create<TFromAgent, TToAgent>(TFromAgent from, TToAgent to, Func<TFromAgent, TToAgent, IEnumerable<IMessage>, CancellationToken, Task<bool>> canTransitionAsync) where TFromAgent : IAgent where TToAgent : IAgent

Parameters

from TFromAgent
to TToAgent
canTransitionAsync Func<TFromAgent, TToAgent, IEnumerable<IMessage>, CancellationToken, Task<bool>>

Returns

Transition

Transition

Type Parameters

TFromAgent
TToAgent

Create<TFromAgent, TToAgent>(TFromAgent, TToAgent, Func<TFromAgent, TToAgent, IEnumerable<IMessage>, Task<bool>>)

Create a new instance of Transition.

public static Transition Create<TFromAgent, TToAgent>(TFromAgent from, TToAgent to, Func<TFromAgent, TToAgent, IEnumerable<IMessage>, Task<bool>> canTransitionAsync) where TFromAgent : IAgent where TToAgent : IAgent

Parameters

from TFromAgent
to TToAgent
canTransitionAsync Func<TFromAgent, TToAgent, IEnumerable<IMessage>, Task<bool>>

Returns

Transition

Transition

Type Parameters

TFromAgent
TToAgent