示例#1
0
        void Instance_OnTasksetChanged(TaskSet setName)
        {
            if (_sw != null)
                _sw.Close();

            _sw = File.CreateText(_startTime.ToString("yyyyMMddHHmm") + "." + ExperimentInfo.Instance.CurrentTaskSet.tasksfile + ".log");
            string header =
                ExperimentInfo.Instance.ParticipantID.ToString() + ";" +
                ExperimentInfo.Instance.CurrentTaskSet + ";" +
                setName.strategy.ToString();

            _startTime = DateTime.Now;

            _sw.WriteLine(header);
        }
示例#2
0
        private TaskSet GetTasksetFromPID(bool first)
        {
            TaskSet ts = new TaskSet();

            string pairs = 
                "Graph1|semantic,Cell2|dynamic " +
                "Sheet1|semantic,MulticastClient2|dynamic " +
                "Cell1|dynamic,Graph2|semantic " +
                "MulticastClient1|dynamic,Sheet2|semantic " +
                "Cell2|semantic,Graph1|dynamic " +
                "MulticastClient2|semantic,Sheet1|dynamic " +
                "Graph2|dynamic,Cell1|semantic " +
                "Sheet2|dynamic,MulticastClient1|semantic";


            string[] pairList = pairs.Split(new char[] { ' ' });

            ts.tasksfile = pairList[ParticipantID % pairList.Length].Split(new char[] { ',' })[first ? 0 : 1].Split(new char[] { '|' })[0] + ".txt";
            ts.strategy = pairList[ParticipantID % pairList.Length].Split(new char[] { ',' })[first ? 0 : 1].Split(new char[] { '|' })[1];

            return ts;
        }