Пример #1
0
 /// <summary>
 /// Constructs the constraint.
 /// </summary>
 /// <param name="parameters">List of parameters.</param>
 /// <param name="constraints">List of constraints.</param>
 public ForallConstraint(Parameters parameters, Constraints constraints)
 {
     Parameters  = parameters;
     Constraints = constraints;
 }
Пример #2
0
 /// <summary>
 /// Constructs the constraint.
 /// </summary>
 /// <param name="name">Preference name.</param>
 /// <param name="constraints">Argument constraints.</param>
 public PreferenceConstraint(string name, Constraints constraints)
 {
     Name        = name;
     Constraints = constraints;
 }
Пример #3
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)}",
                               ")"));
        }