/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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); }
/// <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; }
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(); }
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(); }
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(); }
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; }
/// <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) { }