Ejemplo n.º 1
0
        /// <inheritdoc/>
        public override async Task <bool> Apply(Guid id, AgentInfo agentInfo, AgentStrategyLogicContext context)
        {
            var agent       = context.GrainFactory.GetGrain <IAgent>(id);
            var engagements = await agent.GetActiveEngagements();

            return(engagements.Count() > 0);
        }
Ejemplo n.º 2
0
 public PublishStrategy(ILogger <PublishStrategy> logger)
 {
     Logger          = logger;
     StrategyContext = new AgentStrategyLogicContext(GrainFactory);
 }
Ejemplo n.º 3
0
 public HibernateStrategy(ILogger <HibernateStrategy> logger)
 {
     Logger          = logger;
     StrategyContext = new AgentStrategyLogicContext(GrainFactory);
 }
Ejemplo n.º 4
0
 /// <inheritdoc/>
 public override Task <bool> Apply(Guid id, AgentInfo agentInfo, AgentStrategyLogicContext context)
 {
     return(Task.FromResult(true)); // TODO: Make some simple check about the score of the agent
 }
Ejemplo n.º 5
0
 /// <inheritdoc/>
 public override Task <bool> Apply(Guid id, AgentInfo agentInfo, AgentStrategyLogicContext context)
 {
     return(Task.FromResult(true));
 }
Ejemplo n.º 6
0
 /// <inheritdoc/>
 public abstract Task <bool> Apply(Guid id, AgentInfo agentInfo, AgentStrategyLogicContext context);
Ejemplo n.º 7
0
 public SubscribeStrategy(ILogger <SubscribeStrategy> logger)
 {
     Logger          = logger;
     StrategyContext = new AgentStrategyLogicContext(GrainFactory);
 }