示例#1
0
 /// <summary>
 /// Accept method for the input data visitor.
 /// </summary>
 /// <param name="visitor">Visitor.</param>
 public void Accept(IVisitor visitor)
 {
     visitor.Visit(this);
     Requirements.Accept(visitor);
     Types.Accept(visitor);
     Constants.Accept(visitor);
     Predicates.Accept(visitor);
     Functions.Accept(visitor);
     Constraints.Accept(visitor);
     Actions.Accept(visitor);
     DurativeActions.Accept(visitor);
     DerivedPredicates.Accept(visitor);
 }
示例#2
0
        /// <summary>
        /// String representation.
        /// </summary>
        /// <returns>String representation.</returns>
        public override string ToString()
        {
            List <string> sections = new List <string>
            {
                Requirements.ToString(), Types.ToString(), Constants.ToString(), Predicates.ToString(), Functions.ToString(),
                          Constraints.ToString(), Actions.ToString(), DurativeActions.ToString(), DerivedPredicates.ToString()
            };

            sections.RemoveAll(string.IsNullOrEmpty);

            return(string.Join(Environment.NewLine,
                               $"(define(domain {Name})",
                               $" {string.Join($"{Environment.NewLine} ", sections)}",
                               ")"));
        }