示例#1
0
 public BehaviorTreeRoot(
     Dictionary <int, IBehaviorNode> branchMap,
     Configuration configuration,
     BlackBoard blackBoard,
     AgentChannel agentChannel
     )
 {
     this.branchMap     = branchMap;
     this.configuration = configuration;
     this.blackBoard    = blackBoard;
     this.agentChannel  = agentChannel;
 }
        public ActionResult Join(Guid id)
        {
            CommunicationChannel communicationChannel = db.CommunicationChannels.Where(ch => ch.Id == id).Include(ch => ch.ApplicationUser).First();
            var agentChannel = new AgentChannel()
            {
                AgentUserName = User.Identity.Name,
                ChannelId     = communicationChannel.Id
            };

            db.AgentChannels.Add(agentChannel);
            communicationChannel.NumberOfAgents++;
            db.SaveChanges();

            return(RedirectToAction("Details", new { id = communicationChannel.Id }));
        }
示例#3
0
 public BehaviorContext(
     BlackBoard blackBoard,
     AgentChannel agentChannel,
     string agentId,
     bool isTimeLimit = false,
     float timeout    = 0,
     bool isHopLimit  = false,
     int hopout       = 0
     )
 {
     this.blackBoard   = blackBoard;
     this.agentChannel = agentChannel;
     this.agentId      = agentId;
     this.isTimeLimit  = isTimeLimit;
     this.timeout      = timeout;
     this.isHopLimit   = isHopLimit;
     this.hopout       = hopout;
 }
示例#4
0
 public BehaviorTreeBuilder SetAgentChannel(AgentChannel agentChannel)
 {
     this.agentChannel = agentChannel;
     return(this);
 }