Exemplo n.º 1
0
        internal void Feedback(string experimentId, int taskId, string message)
        {
            lock (_L_users)
            {
                CallSerializer _feedbackCall;
                if (!_experimentToFeedbackCall.TryGetValue(experimentId, out _feedbackCall))
                {
                    var experiment = Experiments.Get(experimentId);
                    if (experiment != null)
                    {
                        var feedbackPath    = experiment.GetFeedbackPath();
                        var feedbackStorage = new CallStorage(feedbackPath);
                        _feedbackCall = feedbackStorage.RegisterCall("Feedback", (c) => { });
                        _experimentToFeedbackCall[experimentId] = _feedbackCall;
                    }
                }


                _feedbackCall.ReportParameter("user_id", UserID);
                _feedbackCall.ReportParameter("message", message);
                _feedbackCall.ReportParameter("experiment_id", experimentId);
                _feedbackCall.ReportParameter("task_id", taskId.ToString());
                _feedbackCall.SaveReport();
            }
        }
        internal QuestionAnsweringModuleBase(ComposedGraph graph, CallStorage storage)
        {
            Storage = storage;
            Pool    = new ContextPool(graph);

            _adviceAnswer = storage.RegisterCall("AdviceAnswer", c =>
            {
                _AdviceAnswer(c.String("question"), c.Bool("isBasedOnContext"), c.Node("correctAnswerNode", Graph), c.Nodes("context", Graph));
            });

            _repairAnswer = storage.RegisterCall("RepairAnswer", c =>
            {
                _RepairAnswer(c.String("question"), c.Node("suggestedAnswer", Graph), c.Nodes("context", Graph));
            });

            _setEquivalencies = storage.RegisterCall("SetEquivalence", c =>
            {
                SetEquivalence(c.String("patternQuestion"), c.String("queriedQuestion"), c.Bool("isEquivalent"));
            });

            _negate = storage.RegisterCall("Negate", c =>
            {
                Negate(c.String("question"));
            });
        }
Exemplo n.º 3
0
        public SimCorpMobile(IOutput output)
        {
            Output         = output;
            vModelName     = "SimCorp Mobile";
            vBattery       = new LiIonBattery(3000, 1500);
            vSpeaker       = new StereoSpeakerSystem(new RealSpeaker(2), new RealSpeaker(2), 40, this.Output);
            vSpeakerName   = nameof(StereoSpeakerSystem);
            vKeyBoard      = new TouchScreenKeyboard();
            vMicrophone    = new MobileMicrophone();
            vSimCard       = new DualSimCardSlot(SimCardTypes.MicroSimCard, SimCardTypes.NanoSimCard);
            vScreen        = new OLEDScreen(1280, 720, 280);
            vMainCamera    = new VideoCamera("Main", 13, true, true);
            vFrontalCamera = new VideoCamera("Frontal", 5, true, true);
            vCallStor      = new CallStorage();
            Contact contact1 = new Contact("Taras", new List <string> {
                "0633333333", "0966666666"
            });
            Contact contact2 = new Contact("Jeeves", "0674612131");
            Contact contact3 = new Contact("Wooster", "0503322189");

            vContactStor = new ContactStorage(new List <Contact> {
                contact1, contact2, contact3
            });
            CallGen = new CallGenerator(vContactStor);
            CallGen.CallReceived += OnCallReceived;
        }
Exemplo n.º 4
0
        public CallViewerForm()
        {
            InitializeComponent();

            storage            = new CallStorage();
            storage.CallAdded += RefreshCallListView;
            callProvider       = new CallProvider(storage);
            callProvider.StartGenerateCalls();
        }
Exemplo n.º 5
0
 public Form1()
 {
     InitializeComponent();
     lock_obj           = new object();
     callList           = new List <CallViewModel>();
     storage            = new CallStorage();
     storage.CallAdded += ReshrechCallView;
     provider           = new CallProvider(storage);
     provider.Stast();
 }
Exemplo n.º 6
0
        public void AddItemSortTest()
        {
            List <Call> calls   = InitCalls();
            var         storage = new CallStorage();

            storage.AddCall(calls[0]);
            storage.AddCall(calls[1]);
            storage.AddCall(calls[2]);
            storage.AddCall(calls[3]);

            IEnumerable <Call> exp_calls = new List <Call>
            {
                calls[3], calls[1], calls[0], calls[2]
            };

            Assert.IsTrue(Enumerable.SequenceEqual(exp_calls, storage.GetCallList()));
        }
Exemplo n.º 7
0
        public void RemoveTest()
        {
            PhoneCall1 call1 = new PhoneCall1("123", true, cont);
            PhoneCall2 call2 = new PhoneCall2("123", false, cont);
            PhoneCall3 call3 = new PhoneCall3("123", true, cont);

            expCallList = new List <PhoneCall> {
                call3, call1
            };
            CallStor = new CallStorage(new List <PhoneCall> {
                call2, call3, call1
            });
            CallStor.CallRemoved += OnCallDummy;

            CallStor.Remove(call2);

            Assert.IsTrue(expCallList.SequenceEqual(CallStor.CallList));
        }
Exemplo n.º 8
0
        internal SolutionLog(UserData userData, ExperimentBase experiment, int taskId)
        {
            _experiment = experiment;
            _taskId     = taskId;
            _task       = experiment.GetTask(taskId);

            var isInitialized = false;
            var logPath       = experiment.GetLogPath(userData.UserID, taskId);

            _logStorage       = new CallStorage(logPath);
            _infoCall         = _logStorage.RegisterCall("Info", c => { isInitialized = true; });
            _completitionCall = _logStorage.RegisterCall("ReportTaskCompletition", c => { });

            _logStorage.ReadStorage();
            if (!isInitialized)
            {
                logInfo("solution initialized");
            }

            reportTaskStart(_task);

            //console has to be created after log storage is prepared
            _console = createConsole(taskId);
        }
Exemplo n.º 9
0
 internal CallPolicy([Import(RequiredCreationPolicy = CreationPolicy.Shared)]
                     CallStorage <T> storage) : base(storage)
 {
 }
Exemplo n.º 10
0
 internal ProbabilisticQAManager(ComposedGraph graph, CallStorage storage)
 {
     _pool   = new ContextPool(graph);
     _module = new ProbabilisticQAModule(_pool.Graph, storage);
 }
Exemplo n.º 11
0
 public HeuristicQAModule(ComposedGraph graph, CallStorage storage)
     : base(graph, storage)
 {
     Triggers = new UtteranceMapping <ActionBlock>(graph);
 }
Exemplo n.º 12
0
 internal MappedQAModule(ComposedGraph graph, CallStorage storage)
     : base(graph, storage)
 {
     _mapping = new FeatureMapping(graph);
 }
Exemplo n.º 13
0
 public StateContext(HeuristicQAModule module)
 {
     QuestionAnsweringModule = module;
     CallStorage             = module.Storage;
     Graph = module.Graph;
 }
Exemplo n.º 14
0
 public ProbabilisticQAModule(ComposedGraph graph, CallStorage storage)
     : base(graph, storage)
 {
 }