コード例 #1
0
 /// <summary>
 /// Creates a new island detector.
 /// </summary>
 /// <param name="network">The network.</param>
 /// <param name="profile">The profile.</param>
 /// <param name="restrictions">The restrictions.</param>
 public EdgeBasedIslandDetector(RoutingNetwork network, Func <ushort, Factor> profile,
                                RestrictionCollection restrictions = null)
 {
     _network      = network;
     _profile      = profile;
     _restrictions = restrictions;
 }
コード例 #2
0
ファイル: DualGraphBuilder.cs プロジェクト: zyhong/routing
 /// <summary>
 /// Creates a new dual graph builder.
 /// </summary>
 public DualGraphBuilder(Graphs.Graph source, DirectedMetaGraph target,
                         WeightHandler <T> weightHandler, RestrictionCollection restrictions)
 {
     _source        = source;
     _target        = target;
     _weightHandler = weightHandler;
     _restrictions  = restrictions;
 }
コード例 #3
0
 /// <summary>
 /// Creates a new many-to-many algorithm instance.
 /// </summary>
 public DirectedManyToManyWeights(Graph graph, WeightHandler <T> weightHandler, RestrictionCollection restrictions,
                                  DirectedDykstraSource <T>[] sources, DirectedDykstraSource <T>[] targets, T maxSearch)
 {
     _graph         = graph;
     _sources       = sources;
     _targets       = targets;
     _weightHandler = weightHandler;
     _maxSearch     = maxSearch;
     _restrictions  = restrictions;
 }
コード例 #4
0
        /// <summary>
        /// Creates a new contracted bidirectional router.
        /// </summary>
        public BidirectionalDykstra(DirectedMetaGraph graph, RestrictionCollection restrictions, WeightHandler <T> weightHandler, IEnumerable <EdgePath <T> > sources, IEnumerable <EdgePath <T> > targets)
        {
            weightHandler.CheckCanUse(graph);

            _graph         = graph;
            _sources       = sources;
            _targets       = targets;
            _weightHandler = weightHandler;
            _restrictions  = restrictions;
        }
コード例 #5
0
 /// <summary>
 /// Creates a new one-to-all dykstra algorithm instance.
 /// </summary>
 public DirectedDykstra(Graph graph, WeightHandler <T> weightHandler, RestrictionCollection restrictions,
                        DirectedDykstraSource <T> source, T sourceMax, bool backward)
 {
     _graph         = graph;
     _source        = source;
     _weightHandler = weightHandler;
     _sourceMax     = sourceMax;
     _backward      = backward;
     _restrictions  = restrictions;
 }
コード例 #6
0
 /// <summary>
 /// Returns true if this turn is restricted by one of the restrictions in the given collection.
 /// </summary>
 public bool IsRestrictedBy(RestrictionCollection restrictions)
 {
     for (var r = 0; r < restrictions.Count; r++)
     {
         if (IsRestrictedBy(restrictions[r]))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #7
0
        /// <summary>
        /// Creates a new hierarchy builder.
        /// </summary>
        public HierarchyBuilder(DirectedMetaGraph graph, RestrictionCollection restrictions, IPriorityCalculator priorityCalculator, IWitnessCalculator witnessCalculator,
                                WeightHandler <T> weightHandler)
        {
            weightHandler.CheckCanUse(graph);

            _graph = graph;
            _priorityCalculator = priorityCalculator;
            _witnessCalculator  = witnessCalculator;
            _weightHandler      = weightHandler;
            _restrictions       = restrictions;
        }
コード例 #8
0
ファイル: Viewport2D.cs プロジェクト: lulzzz/HedgeHog
		internal Viewport2D(FrameworkElement host, Plotter2D plotter)
		{
			this.hostElement = host;
			host.ClipToBounds = true;
			host.SizeChanged += new SizeChangedEventHandler(OnHostElementSizeChanged);

			this.plotter = plotter;
			plotter.Children.CollectionChanged += OnPlotterChildrenChanged;

			restrictions = new RestrictionCollection(this);
			restrictions.Add(new MinimalSizeRestriction());
			restrictions.CollectionChanged += restrictions_CollectionChanged;

			fitToViewRestrictions = new RestrictionCollection(this);
			fitToViewRestrictions.CollectionChanged += fitToViewRestrictions_CollectionChanged;

			readonlyContentBoundsHosts = new ReadOnlyObservableCollection<IPlotterElement>(contentBoundsHosts);

			UpdateVisible();
			UpdateTransform();
		}
コード例 #9
0
        protected internal Viewport2D(FrameworkElement host, Plotter2D plotter)
        {
            hostElement = host;
            host.ClipToBounds = true;
            host.SizeChanged += OnHostElementSizeChanged;

            this.plotter = plotter;
            plotter.Children.CollectionChanged += OnPlotterChildrenChanged;

            restrictions = new RestrictionCollection(this);
            restrictions.Add(new MinimalSizeRestriction());
            restrictions.CollectionChanged += restrictions_CollectionChanged;

            fitToViewRestrictions = new RestrictionCollection(this);
            fitToViewRestrictions.CollectionChanged += fitToViewRestrictions_CollectionChanged;

            readonlyContentBoundsHosts = new ReadOnlyObservableCollection<DependencyObject>(contentBoundsHosts);

            UpdateVisible();
            UpdateTransform();
        }
コード例 #10
0
ファイル: Viewport2D.cs プロジェクト: donllen/DDD
        protected internal Viewport2D(FrameworkElement host, Plotter2D plotter)
        {
            // MaxWidth = -1;//默认初始为-1,不限制缩放
            hostElement       = host;
            host.ClipToBounds = true;
            host.SizeChanged += OnHostElementSizeChanged;

            this.plotter = plotter;
            plotter.Children.CollectionChanged += OnPlotterChildrenChanged;

            restrictions = new RestrictionCollection(this);
            restrictions.Add(new MinimalSizeRestriction());
            restrictions.CollectionChanged += restrictions_CollectionChanged;

            fitToViewRestrictions = new RestrictionCollection(this);
            fitToViewRestrictions.CollectionChanged += fitToViewRestrictions_CollectionChanged;

            readonlyContentBoundsHosts = new ReadOnlyObservableCollection <DependencyObject>(contentBoundsHosts);

            UpdateVisible();
            UpdateTransform();
        }
コード例 #11
0
ファイル: metadata.cs プロジェクト: JordanChin/Ingres
        private static string AddRestrictionsToSqlQueryText(
			string sql, RestrictionCollection restrictions, string[] restrictionValues)
        {
            for(int i = 0; i < restrictions.Restrictions.Length; i++)
            {
                Restriction restriction = restrictions.Restrictions[i];
                string restrictionValue = restrictionValues[i];
                if (restrictionValue == null)
                    continue;
                string restrictionName =
                    restriction.IngresCatalogColumnName != null ?
                    restriction.IngresCatalogColumnName :
                    restriction.Name;
                string valueQuoted = QuoteLiteral(restrictionValue);
                sql = sql + restrictionName + " = " + valueQuoted + " AND ";
            }  // end for loop through restrictions

            return sql;
        }
コード例 #12
0
 /// <summary>
 /// Creates a new one-to-all dykstra algorithm instance.
 /// </summary>
 public DirectedDykstra(Graph graph, WeightHandler <T> weightHandler, RestrictionCollection restrictions,
                        DirectedEdgeId source, T sourceMax, bool backward)
     : this(graph, weightHandler, restrictions, new DirectedDykstraSource <T>(source, weightHandler.Zero), sourceMax, backward)
 {
 }