Class Transition
Represents a transition between two agents.
public class Transition
- Inheritance
-
Transition
- Inherited Members
Properties
From
public IAgent From { get; }
Property Value
To
public IAgent To { get; }
Property Value
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
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
TFromAgentto
TToAgent
Returns
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
TFromAgentto
TToAgentcanTransitionAsync
Func<TFromAgent, TToAgent, IEnumerable<IMessage>, CancellationToken, Task<bool>>
Returns
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
TFromAgentto
TToAgentcanTransitionAsync
Func<TFromAgent, TToAgent, IEnumerable<IMessage>, Task<bool>>
Returns
Type Parameters
TFromAgent
TToAgent