コード例 #1
0
        /// <summary>
        /// Gets NARoute U-Turn policy.
        /// </summary>
        /// <returns>NARoute U-Turn policy according by UTurn policy from SolverSettings.</returns>
        private string _GetUTurnPolicy()
        {
            UTurnPolicy policy = _context.SolverSettings.GetUTurnPolicy();

            string value = NARouteUTurnPolicy.NoUTurns;

            switch (policy)
            {
            case UTurnPolicy.Nowhere:
                value = NARouteUTurnPolicy.NoUTurns;
                break;

            case UTurnPolicy.AtDeadEnds:
                value = NARouteUTurnPolicy.AllowDeadEndsOnly;
                break;

            case UTurnPolicy.AtDeadEndsAndIntersections:
                value = NARouteUTurnPolicy.AllowDeadEndsAndIntersectionsOnly;
                break;

            default:
                // Not supported.
                Debug.Assert(false);
                break;
            }

            return(value);
        }
コード例 #2
0
        /// <summary>
        /// Method gets U-Turn policy for orders according to settings.
        /// </summary>
        /// <returns>U-Turn policy.</returns>
        public UTurnPolicy GetUTurnPolicy()
        {
            UTurnPolicy policy = new UTurnPolicy();

            if (UTurnAtDeadEnds && UTurnAtIntersections)
            {
                policy = UTurnPolicy.AtDeadEndsAndIntersections;
            }
            else if (!UTurnAtDeadEnds && !UTurnAtIntersections)
            {
                policy = UTurnPolicy.Nowhere;
            }
            else if (UTurnAtDeadEnds && !UTurnAtIntersections)
            {
                policy = UTurnPolicy.AtDeadEnds;
            }
            else
            {
                // Not supported. Set default one.
                policy = UTurnPolicy.Nowhere;
            }

            return(policy);
        }
コード例 #3
0
        /// <summary>
        /// Method gets U-Turn policy for orders according to settings.
        /// </summary>
        /// <returns>U-Turn policy.</returns>
        public UTurnPolicy GetUTurnPolicy()
        {
            UTurnPolicy policy = new UTurnPolicy();

            if (UTurnAtDeadEnds && UTurnAtIntersections)
            {
                policy = UTurnPolicy.AtDeadEndsAndIntersections;
            }
            else if (!UTurnAtDeadEnds && !UTurnAtIntersections)
            {
                policy = UTurnPolicy.Nowhere;
            }
            else if (UTurnAtDeadEnds && !UTurnAtIntersections)
            {
                policy = UTurnPolicy.AtDeadEnds;
            }
            else
            {
                // Not supported. Set default one.
                policy = UTurnPolicy.Nowhere;
            }

            return policy;
        }