public AccesibleConditionQuery(QuestionType questionType, string condition, ScenarioDescription scenario)
            : base(QueryType.AccesibleCondition, questionType)
        {
            _queryType = QueryType.AccesibleCondition;
            _condition = condition;
            var logicExp = new SimpleLogicExpression(this._condition);
            _fluentNames = logicExp.GetFluentNames();
            _scenario = scenario;

            ExecQuery = new ExecutableScenarioQuery(QuestionType.Ever, _scenario);
            CondAtTimeQuery = new ConditionAtTimeQuery(QuestionType.Ever, _condition);

            _logger.Info("Creates:\n " + this);
        }
        public void CheckConditionAtTimeNoTimeQueryResultUndefined()
        {
            const int Time = 0;
            _query = new ConditionAtTimeQuery(QuestionType.Ever, "aa && bb");
            var state = new State();
            var fluentList = new List<Fluent>
                             {
                                 new Fluent("aa", true),
                                 new Fluent("bb", false)
                             };
            state.Fluents.AddRange(fluentList);

            QueryResult result = _query.CheckCondition(state, null, Time);

            Assert.AreEqual(QueryResult.Undefined, result);
        }
        public void CheckConditionAtTimeAfterTimeTrue()
        {
            const int Time = 10;
            _query = new ConditionAtTimeQuery(QuestionType.Ever, "aa && bb", Time - 1);
            var state = new State();
            var fluentList = new List<Fluent>
                             {
                                 new Fluent("aa", true),
                                 new Fluent("bb", true)
                             };
            state.Fluents.AddRange(fluentList);

            QueryResult result = _query.CheckCondition(state, null, Time);

            Assert.AreEqual(QueryResult.True, result);
        }
        public AccesibleConditionQuery(QuestionType questionType, string condition, ScenarioDescription scenario)
            : base(QueryType.AccesibleCondition, questionType)
        {
            _queryType = QueryType.AccesibleCondition;
            _condition = condition;
            var logicExp = new SimpleLogicExpression(this._condition);

            _fluentNames = logicExp.GetFluentNames();
            _scenario    = scenario;


            ExecQuery       = new ExecutableScenarioQuery(QuestionType.Ever, _scenario);
            CondAtTimeQuery = new ConditionAtTimeQuery(QuestionType.Ever, _condition);


            _logger.Info("Creates:\n " + this);
        }