示例#1
0
        /// <summary>
        /// Constructs the SAS+ planning problem from the input data.
        /// </summary>
        /// <param name="inputData">Input data.</param>
        public Problem(InputData.SASInputData inputData)
        {
            ProblemName       = inputData.Problem.Name;
            OriginalInputData = inputData;

            InitialState   = new State(inputData.Problem.InitialState);
            GoalConditions = new Conditions(inputData.Problem.GoalConditions);
            Variables      = new Variables(inputData.Problem.Variables);
            MutexGroups    = new MutexGroups(inputData.Problem.MutexGroups);
            AxiomRules     = new AxiomRules(inputData.Problem.AxiomRules, Variables, InitialState);
            Operators      = new Operators(inputData.Problem.Operators, AxiomRules, MutexGroups);

            Variables.SetOperators(Operators);
            TransitionsGenerator = new Lazy <TransitionsGenerator>(() => new TransitionsGenerator(this));
            MutexChecker         = new Lazy <MutexChecker>(() => new MutexChecker(MutexGroups));
        }
 /// <summary>
 /// Builds the successors generator.
 /// </summary>
 /// <param name="operators">Operators of the SAS+ planning problem.</param>
 /// <param name="variables">Variables data of the SAS+ planning problem.</param>
 /// <param name="mutexGroups">Mutex groups of the SAS+ planning problem.</param>
 public SuccessorsGenerator(Operators operators, Variables variables, MutexGroups mutexGroups)
 {
     TreeRoot            = OperatorDecisionTreeBuilder.BuildApplicabilityTree(operators, variables);
     SuccessorsCollector = new SuccessorsCollector(mutexGroups);
 }
 /// <summary>
 /// Constructs the successors collector.
 /// </summary>
 /// <param name="mutexGroups">Mutex groups of the SAS+ planning problem.</param>
 public SuccessorsCollector(MutexGroups mutexGroups)
 {
     MutexChecker = new Lazy <MutexChecker>(() => new MutexChecker(mutexGroups));
 }
示例#4
0
        /// <summary>
        /// Constructs the list of grounded SAS+ operators from the input data.
        /// </summary>
        /// <param name="inputData">Input data.</param>
        /// <param name="axiomRules">Axiom rules of the SAS+ planning problem.</param>
        /// <param name="mutexGroups">Mutex groups of the SAS+ planning problem.</param>
        public Operators(InputData.SAS.Operators inputData, AxiomRules axiomRules, MutexGroups mutexGroups)
        {
            int operatorIndex = 0;

            inputData.ForEach(oper => Add(new Operator(oper, operatorIndex++, axiomRules, mutexGroups)));
        }
示例#5
0
        /// <summary>
        /// Constructs the SAS+ operator from the input data.
        /// </summary>
        /// <param name="inputData">Operator input data.</param>
        /// <param name="index">Operator index.</param>
        /// <param name="axiomRules">Axiom rules of the SAS+ planning problem.</param>
        /// <param name="mutexGroups">Mutex groups of the SAS+ planning problem.</param>
        public Operator(InputData.SAS.Operator inputData, int index, AxiomRules axiomRules, MutexGroups mutexGroups)
        {
            Name          = inputData.Name;
            Id            = index;
            Preconditions = new Conditions(inputData.Conditions);
            Effects       = new Effects(inputData.Effects, axiomRules);
            Cost          = inputData.Cost;

            MutexChecker = new Lazy <MutexChecker>(() => new MutexChecker(mutexGroups));
        }