예제 #1
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)}",
                               ")"));
        }
예제 #2
0
        /// <summary>
        /// String representation.
        /// </summary>
        /// <returns>String representation.</returns>
        public override string ToString()
        {
            List <string> sections = new List <string>
            {
                Requirements.ToString(), Objects.ToString(), Init.ToString(), Goal.ToString(), Constraints.ToString(),
                          Metric.ToString(), Length.ToString()
            };

            sections.RemoveAll(string.IsNullOrEmpty);

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