Exemple #1
0
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents the current <see cref="ZincSolveItem"/>.
        /// </summary>
        /// <returns>A <see cref="System.String"/> that represents the current <see cref="ZincSolveItem"/>.</returns>
        /// <remarks>
        /// <para>The format of this method is <c>solve annotations type expression</c> where the annotations
        /// annotate the solve item, the <c>type</c> is <c>satisfy</c>, <c>minimize</c> and <c>maximize</c>. and
        /// <c>expression</c> the expression to be minimized/maximized.</para>
        /// </remarks>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder("solve ");

            if (this.Annotations != null && this.Annotations.Count > 0x00)
            {
                sb.Append(this.Annotations);
                sb.Append(' ');
            }
            sb.Append(ZincPrintUtils.SolveTypeLiteral(this.SolveType));
            if (this.SolveType != ZincSolveType.Satisfy)
            {
                sb.Append(' ');
                sb.Append(this.Expression);
            }

            return(sb.ToString());
        }