Ejemplo n.º 1
0
 public Brain(BrainSaveData saveData)
 {
     _decisionMaker = saveData.DecisionMaker.Instantiate();
     _sequenceMaker = saveData.SequenceMaker.Instantiate();
     _currentAction = saveData.CurrentAction.Instantiate();
     _lastState     = new State(saveData.LastState);
 }
Ejemplo n.º 2
0
        public LanguageDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, ISubscriptionManager SubscriptionManager,
                              ThreadedLogger _myLogger,
                              IEmailSender emailSender,
                              StuddyBotContext db,
                              IConfiguration configuration)
            : base(nameof(LanguageDialog))//, dialogInfoStateProperty)

        {
            _Logger       = _myLogger;
            DecisionMaker = decisionMaker;

            _dialogInfoStateProperty = dialogInfoStateProperty;
            _Configuration           = configuration;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                CheckLanguageStepAsync,
                ChangeLanguageStepAsync,
                SetUserLanguageAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
 public MainWindow()
 {
     InitializeComponent();
     //decisionMaker = new RandomDecisionMaker();
     decisionMaker = new TDNNDecisionMaker();
     randomTimer.Interval = new TimeSpan(2000000);
 }
Ejemplo n.º 4
0
        public LocationDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, ISubscriptionManager SubscriptionManager,
                              ThreadedLogger _myLogger,
                              //DialogInfo dialogInfo,
                              //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                              IEmailSender emailSender,
                              StuddyBotContext db)
            : base(nameof(LocationDialog))//, dialogInfoStateProperty)

        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;
            //_DialogInfo = dialogInfo;
            //_conversationReferences = conversationReferences;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new MainMenuDialog(dialogInfoStateProperty, DecisionMaker, SubscriptionManager, _myLogger,
                                         //_DialogInfo,
                                         //_conversationReferences,
                                         db,
                                         emailSender));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                GetCountryStepAsync,
                GetCityStepAsync,
                CallMenuDialogStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 5
0
        public MailingDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, IEmailSender emailSender, ISubscriptionManager SubscriptionManager,
                             ThreadedLogger _myLogger,
                             StuddyBotContext db
                             )
            : base(nameof(MailingDialog))
        {
            this._myLogger           = _myLogger;
            DecisionMaker            = decisionMaker;
            EmailSender              = emailSender;
            _db                      = db;
            _dialogInfoStateProperty = dialogInfoStateProperty;
            _subscriptionManager     = SubscriptionManager;

            AddDialog(new TextPrompt(nameof(TextPrompt)));

            AddDialog(new TextPrompt("email", EmailFormValidator));
            AddDialog(new ChoicePrompt("validation", CodeValidator));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new FinishDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                       _myLogger,
                                       db
                                       ));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                CheckForEmailStepAsync,
                AskEmailStepAsync,
                SendDialogStepAsync,
                FinalStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 6
0
 public Player(IDecisionMaker decisionMaker = null)
 {
     this.Hand    = new Deck();
     this.Animals = new ObservableCollection <Animal>();
     this.Discard = new Deck();
     this.Brain   = decisionMaker ?? new RandomDecisionMaker();
 }
Ejemplo n.º 7
0
        public SubscriptionDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, IEmailSender emailSender, ISubscriptionManager subscriptionManager,
                                  ThreadedLogger _myLogger,
                                  //DialogInfo dialogInfo,
                                  //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                                  StuddyBotContext db
                                  )
            : base(nameof(SubscriptionDialog))
        {
            this._myLogger           = _myLogger;
            DecisionMaker            = decisionMaker;
            _subscriptionManager     = subscriptionManager;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new ChooseOptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, subscriptionManager,
                                             _myLogger,
                                             //dialogInfo,
                                             //conversationReferences,
                                             db
                                             ));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                FirstStepAsync,
                UnsubStepAsync,
                DeleteSubscriptionStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 8
0
        public QAsDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, IEmailSender emailSender, ISubscriptionManager SubscriptionManager,
                         ThreadedLogger _myLogger,
                         //DialogInfo dialogInfo,
                         //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                         StuddyBotContext db
                         )
            : base(nameof(QAsDialog))
        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;

            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new AddQuestionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, _myLogger,
                                            db
                                            ));
            AddDialog(new FinishDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                       _myLogger,
                                       db
                                       ));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskSelectQAStepAsync,
                FinalStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 9
0
 public DialogAndWelcomeBot(ConversationState conversationState, UserState userState, T dialog,
                            ILogger <DialogBot <T> > logger, IDecisionMaker decisionMaker, ThreadedLogger Logger)
     : base(conversationState, userState, dialog, logger, decisionMaker)
 {
     _Logger        = Logger;
     _decisionMaker = decisionMaker;
 }
Ejemplo n.º 10
0
        public NotificationController(IBotFrameworkHttpAdapter adapter,
                                      ICredentialProvider credentials,
                                      //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                                      StuddyBotContext db,
                                      IEmailSender emailSender,
                                      ISubscriptionManager subscriptionManager,
                                      IDecisionMaker decisionMaker)
        {
            _adapter = adapter;
            //_conversationReferences = conversationReferences;
            _appId               = ((SimpleCredentialProvider)credentials).AppId;
            _db                  = db;
            _emailSender         = emailSender;
            _decisionMaker       = decisionMaker;
            _subscriptionManager = subscriptionManager;

            // If the channel is the Emulator, and authentication is not in use,
            // the AppId will be null.  We generate a random AppId for this case only.
            // This is not required for production, since the AppId will have a value.
            if (string.IsNullOrEmpty(_appId))
            {
                _appId = Guid.NewGuid().ToString(); //if no AppId, use a random Guid
            }

            // _appId = "123";
        }
Ejemplo n.º 11
0
        public ChooseOptionDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, IEmailSender emailSender, ISubscriptionManager SubscriptionManager,
                                  ThreadedLogger _myLogger,
                                  //DialogInfo dialogInfo,
                                  //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                                  StuddyBotContext db
                                  )
            : base(nameof(ChooseOptionDialog))
        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;
            //_DialogInfo = dialogInfo;
            //_conversationReferences = conversationReferences;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            //AddDialog(new MailingDialog(DecisionMaker, emailSender, SubscriptionManager, _myLogger, dialogInfo, conversationReferences, db));
            //AddDialog(new SubscriptionDialog(DecisionMaker, SubscriptionManager, _myLogger, dialogInfo, conversationReferences));
            //AddDialog(new FinishDialog(DecisionMaker, emailSender, SubscriptionManager, _myLogger, dialogInfo, conversationReferences, db));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                FirstStepAsync,
                RunDialogCourseStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 12
0
        public PlannedEventsDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker,
                                   ThreadedLogger _myLogger,
                                   //DialogInfo dialogInfo,
                                   //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                                   StuddyBotContext db
                                   )
            : base(nameof(PlannedEventsDialog))
        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;
            //_DialogInfo = dialogInfo;
            //_conversationReferences = conversationReferences;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskSelectEventStepAsync,
                FinalStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 13
0
        public AddQuestionDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, IEmailSender emailSender,
                                 ThreadedLogger _myLogger,
                                 //DialogInfo dialogInfo,
                                 //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                                 StuddyBotContext db
                                 )
            : base(nameof(AddQuestionDialog))
        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;
            //_DialogInfo = dialogInfo;
            //_conversationReferences = conversationReferences;
            _db = db;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            //AddDialog(new FinishDialog(DecisionMaker, _myLogger, dialogInfo, conversationReferences));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskForQuestionStepAsync,
                FinalStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 14
0
        public FinishDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, IEmailSender emailSender, ISubscriptionManager SubscriptionManager,
                            ThreadedLogger _myLogger,
                            //DialogInfo dialogInfo,
                            //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                            StuddyBotContext db
                            )
            : base(nameof(FinishDialog))
        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;
            //_DialogInfo = dialogInfo;
            //_conversationReferences = conversationReferences;
            _db = db;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new ChooseOptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                             _myLogger,
                                             //dialogInfo,
                                             //conversationReferences,
                                             db
                                             ));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                DidWeFinishStepAsync,
                LeaveFeedbackStepAsync,
                //testStepAsync,
                FinalStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 15
0
        public override void Init(IDecisionMaker abstractParent)
        {
            var parent   = (RemoteDecisionMaker)abstractParent;
            var parentId = parent.RemoteId;

            Init(parent.Actions);
            RemoteId = parentId;
        }
Ejemplo n.º 16
0
 public DialogBot(ConversationState conversationState, UserState userState, T dialog,
                  ILogger <DialogBot <T> > logger, IDecisionMaker decisionMaker)
 {
     ConversationState = conversationState;
     UserState         = userState;
     Dialog            = dialog;
     Logger            = logger;
     DecisionMaker     = decisionMaker;
 }
Ejemplo n.º 17
0
        public static async Task Main(string[] args)
        {
            try
            {
                Print("2048 bot launched!");
                Print("Ready to beat high scores!");

                IKernel container = BuildContainer();

                IAutomatingControler controler = container.Get <IAutomatingControler>();
                await controler.OpenWebPage();

                IDecisionMaker decisionMaker = container.Get <IDecisionMaker>();
                IGridUpdater   gridUpdater   = container.Get <IGridUpdater>();

                while (true)
                {
                    Stopwatch watch = Stopwatch.StartNew();

                    LineBreak();
                    Print("Starting a new game");

                    Grid grid = new Grid();

                    while (!controler.DetectGameOver())
                    {
                        IEnumerable <GridUpdateInput> updateInputs = controler.ReadGridState();
                        gridUpdater.UpdateGrid(grid, updateInputs);

                        Direction nextDirection = decisionMaker.ChoseDirection(grid);
                        Print($"Moving {nextDirection}");
                        await controler.NextStep(nextDirection);
                    }

                    watch.Stop();

                    long duration = watch.ElapsedMilliseconds;
                    int  score    = controler.ReadScore();

                    Print($"Game finished in {duration}");
                    Print($"Score: {score}");

                    await controler.Replay();
                }
            }
            catch (Exception ex)
            {
                PrintError(ex);
                ExitOnClick();
            }
        }
Ejemplo n.º 18
0
        public HelpDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, ISubscriptionManager SubscriptionManager,
                          ThreadedLogger _myLogger,
                          IEmailSender emailSender,
                          StuddyBotContext db)
            : base(nameof(HelpDialog))//, dialogInfoStateProperty)

        {
            _Logger       = _myLogger;
            DecisionMaker = decisionMaker;

            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new ChooseOptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                             _myLogger, db
                                             ));



            AddDialog(new MainMenuDialog(dialogInfoStateProperty, DecisionMaker, SubscriptionManager, _myLogger,
                                         db,
                                         emailSender));
            AddDialog(new CoursesDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                        _myLogger, db
                                        ));
            AddDialog(new PlannedEventsDialog(dialogInfoStateProperty, DecisionMaker, _myLogger, db
                                              ));
            AddDialog(new QAsDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                    _myLogger, db
                                    ));
            AddDialog(new SubscriptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                             _myLogger, db
                                             ));
            AddDialog(new MailingDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                        _myLogger, db
                                        ));
            AddDialog(new FinishDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                       _myLogger, db
                                       ));



            AddDialog(new TextPrompt(nameof(TextPrompt)));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                ShowHelpAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 19
0
        public GhostLogic(ITreeBuilder <string> treeBuilder, IDecisionMaker <string, int> decisionMaker, IResource <IEnumerable <string> > resource)
        {
            this.treeBuilder   = treeBuilder ?? throw new ArgumentException("It's necessary a tree builder to build a GhostLogic");
            this.decisionMaker = decisionMaker ?? throw new ArgumentException("It's necessary a decision algorithm to build a GhostLogic");

            if (resource == null)
            {
                throw new ArgumentException("It's necessary a resource to build a GhostLogic");
            }

            // Load the dictionary
            dictionary = resource.FecthResource();

            root = this.treeBuilder.Create(dictionary);
        }
Ejemplo n.º 20
0
        public override void Init(IDecisionMaker parent)
        {
            var parentDecisionMaker = (ReinforcementDecisionMaker)parent;

            Init(parentDecisionMaker.Actions);

            CreateTrainer(parentDecisionMaker._inputDimention);

            var serializer = new chainer.serializers.DictionarySerializer();

            parentDecisionMaker._model.Serialize(serializer);
            var savedata     = serializer.Target;
            var deserializer = new chainer.serializers.DictionaryDeserializer(savedata);

            _model.Serialize(deserializer);
        }
Ejemplo n.º 21
0
        public MainMenuDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker,
                              ISubscriptionManager SubscriptionManager,
                              ThreadedLogger _myLogger,
                              //DialogInfo dialogInfo,
                              //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                              StuddyBotContext db,
                              IEmailSender emailSender)
            : base(nameof(MainMenuDialog))
        {
            this._myLogger = _myLogger;
            DecisionMaker  = decisionMaker;

            _dialogInfoStateProperty = dialogInfoStateProperty;


            AddDialog(new CoursesDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                        _myLogger, db
                                        ));
            AddDialog(new ChooseOptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                             _myLogger, db
                                             ));
            AddDialog(new PlannedEventsDialog(dialogInfoStateProperty, DecisionMaker, _myLogger, db
                                              ));
            AddDialog(new QAsDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                    _myLogger, db
                                    ));
            AddDialog(new SubscriptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                             _myLogger, db
                                             ));
            AddDialog(new MailingDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                        _myLogger, db
                                        ));
            AddDialog(new FinishDialog(dialogInfoStateProperty, DecisionMaker, emailSender, SubscriptionManager,
                                       _myLogger, db
                                       ));

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                GetMenuItemsStepAsync,
                StartSelectedDialogStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 22
0
        public EmailDialog(IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty, IDecisionMaker decisionMaker, ISubscriptionManager subscriptionManager, IEmailSender emailSender,
                           ThreadedLogger _myLogger,
                           //DialogInfo dialogInfo,
                           //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                           StuddyBotContext db
                           )
            : base(nameof(EmailDialog))
        {
            this._myLogger       = _myLogger;
            DecisionMaker        = decisionMaker;
            _subscriptionManager = subscriptionManager;
            EmailSender          = emailSender;
            //_DialogInfo = dialogInfo;
            _db = db;
            _dialogInfoStateProperty = dialogInfoStateProperty;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new TextPrompt("email", EmailFormValidator));
            AddDialog(new ChoicePrompt("validation", CodeValidator));
            AddDialog(new SubscriptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, subscriptionManager,
                                             _myLogger,
                                             //dialogInfo,
                                             //conversationReferences,
                                             db
                                             ));
            AddDialog(new ChooseOptionDialog(dialogInfoStateProperty, DecisionMaker, emailSender, subscriptionManager,
                                             _myLogger,
                                             //dialogInfo,
                                             //conversationReferences,
                                             db
                                             ));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                FirstStepAsync,
                ChoiceStepAsync,
                PreFinalStepAsync,
                FinalStepAsync
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 23
0
 public Game(IGameConnector gameConnector, IDecisionMaker decisionMaker)
 {
     this.gameConnector = gameConnector;
     this.decisionMaker = decisionMaker;
 }
 public ClosingDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
Ejemplo n.º 25
0
 public override void Init(IDecisionMaker parent)
 {
     base.Init(parent);
     Init();
 }
Ejemplo n.º 26
0
 public ClosingDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
Ejemplo n.º 27
0
        public MinimaxTest()
        {
            heuristic     = new AHeuristic();
            decisionMaker = new Minimax <string, int>(heuristic);

            #region Tree
            tree = new Node <string>
            {
                Value    = "h",
                Children = new HashSet <Node <string> >
                {
                    new Node <string>
                    {
                        Value    = "he",
                        Children = new HashSet <Node <string> >
                        {
                            new Node <string>
                            {
                                Value    = "hel",
                                Children = new HashSet <Node <string> >
                                {
                                    new Node <string>
                                    {
                                        Value    = "hell",
                                        Children = new HashSet <Node <string> >
                                        {
                                            new Node <string>
                                            {
                                                Value    = "hello",
                                                Terminal = true
                                            },
                                        }
                                    },
                                    new Node <string>
                                    {
                                        Value    = "heli",
                                        Children = new HashSet <Node <string> >
                                        {
                                            new Node <string>
                                            {
                                                Value    = "heliu",
                                                Children = new HashSet <Node <string> >
                                                {
                                                    new Node <string>
                                                    {
                                                        Value    = "helium",
                                                        Terminal = true
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    new Node <string>
                    {
                        Value    = "ha",
                        Children = new HashSet <Node <string> >
                        {
                            new Node <string>
                            {
                                Value    = "hai",
                                Children = new HashSet <Node <string> >
                                {
                                    new Node <string>
                                    {
                                        Value    = "hair",
                                        Terminal = true
                                    }
                                }
                            },
                            new Node <string>
                            {
                                Value    = "hal",
                                Children = new HashSet <Node <string> >
                                {
                                    new Node <string>
                                    {
                                        Value    = "halt",
                                        Terminal = true
                                    }
                                }
                            }
                        }
                    }
                }
            };
            #endregion
        }
 public EndGameDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
 public PlayingSecondDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
Ejemplo n.º 30
0
 public Brain(IDecisionMaker decisionMaker, ISequenceMaker sequenceMaker)
 {
     _decisionMaker = decisionMaker;
     _sequenceMaker = sequenceMaker;
 }
Ejemplo n.º 31
0
        /// <summary>
        /// conversations with users which subscribed to notifications
        /// TODO: possible renaming needed
        /// </summary>
        //private readonly ConcurrentDictionary<string, ConversationReference> _conversationReferences;


        public MainDialog(UserState state, IStatePropertyAccessor <DialogInfo> dialogInfoStateProperty,
                          IConfiguration configuration, IDecisionMaker decisionMaker,
                          ISubscriptionManager subscriptionManager, IEmailSender emailSender,
                          ThreadedLogger Logger,
                            //ConcurrentDictionary<string, ConversationReference> conversationReferences,
                          StuddyBotContext db
                          ) // DialogInfo dialogInfo, StuddyBotContext db
            : base(nameof(MainDialog), dialogInfoStateProperty, Logger)
        {
            Configuration = configuration;
            this._Logger  = Logger;
            DecisionMaker = decisionMaker;
            EmailSender   = emailSender;
            //_conversationReferences = conversationReferences;

            _QuestionAndAnswerModel = new QuestionAndAnswerModel();
            _QuestionAndAnswerModel.QuestionModel           = new QuestionModel();
            _QuestionAndAnswerModel.QuestionModel.Questions = new List <Question>();
            _QuestionAndAnswerModel.QuestionModel.Decisions = new List <DecisionModel>();
            _QuestionAndAnswerModel.Answers = new List <string>();
            _DecisionModel = new DecisionModel();
            //_DialogInfo = new DialogInfo(); //dialogInfo;
            _dialogInfoStateProperty = dialogInfoStateProperty; //state.CreateProperty<DialogInfo>(nameof(DialogInfo));
            //_DialogInfo = _dialogInfoState.GetAsync();

            _db = db;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));

            AddDialog(new LanguageDialog(_dialogInfoStateProperty, DecisionMaker, subscriptionManager, _Logger,
                                         EmailSender, db, Configuration));
            AddDialog(new LocationDialog(_dialogInfoStateProperty, DecisionMaker, subscriptionManager, _Logger,

                                         EmailSender, db));

            AddDialog(new MailingDialog(_dialogInfoStateProperty, DecisionMaker, emailSender, subscriptionManager,
                                        _Logger, db));


            AddDialog(new EmailDialog(_dialogInfoStateProperty, decisionMaker, subscriptionManager, emailSender,
                                      Logger,
                                      //_DialogInfo,
                                      //conversationReferences,
                                      db
                                      ));
            AddDialog(new HelpDialog(_dialogInfoStateProperty, DecisionMaker, subscriptionManager, _Logger,

                                     EmailSender, db));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                StartLanguageDialogAsync
            }));


            StartServices();

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
 public AnnounceDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
Ejemplo n.º 33
0
 public MessageProcessor(IDecisionMaker decisionMaker)
 {
     _decisionMaker = decisionMaker;
 }
 public ChangeTrumpDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Initializes a new instance of DecisionMaker class.
 /// </summary>
 public Bot(Point firstCardLocation, int cardWidth)
     : base(firstCardLocation, cardWidth)
 {
     this.decisionMaker = new DecisionMaker();
 }
Ejemplo n.º 36
0
 public AnnounceDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }
Ejemplo n.º 37
0
 /// <summary>
 /// Initializes a new instance of DecisionMaker class.
 /// </summary>
 public Bot()
 {
     this.decisionMaker = new DecisionMaker();
 }
Ejemplo n.º 38
0
 /// <summary>
 /// Initializes a new instance of DecisionMaker class.
 /// </summary>
 public Bot(Point firstCardLocation, int cardWidth)
     : base(firstCardLocation, cardWidth)
 {
     this.decisionMaker = new DecisionMaker();
 }
 public EndGameDecisionMaker(IDecisionMaker next)
 {
     this.Next = next;
 }