protected BaseAlgorithm(IGraph graph, IEndPoints endPoints) { visitedVertices = new VisitedVertices(); parentVertices = new ParentVertices(); this.graph = graph; this.endPoints = new EndPoints(endPoints); }
public AStarModified(IGraph graph, IEndPoints endPoints, IStepRule stepRule, IHeuristic function) : base(graph, endPoints, stepRule, function) { PercentOfFarthestVerticesToDelete = CalculatePercentOfFarthestVerticesToDelete; deletedVertices = new Queue <IVertex>(); }
/// <summary> /// Initializes a new instance of the <see cref="BolRetailerApi"/> class. /// Setup the necessary objects. This object can be used to inject via DI. /// </summary> /// <param name="clientId">The client identifier.</param> /// <param name="clientSecret">The client secret.</param> /// <param name="httpClient">The HTTP client.</param> /// <param name="testMode">if set to <c>true</c> [test mode].</param> public BolRetailerApi(string clientId, string clientSecret, HttpClient httpClient, bool testMode = false) { RateLimits = new RateLimits(); EndPoints = testMode ? new TestEndPoints() : new EndPoints(); _httpClient = httpClient; _authorizationToken = new AuthorizationToken(clientId, clientSecret, TokenService); }
public static void Highlight(this IGraphPath self, IEndPoints endpoints) { self.Path .Except(endpoints.Source, endpoints.Target) .OfType <IMarkable>() .ForEach(vertex => vertex.MarkAsPath()); }
public static void Highlight(this IGraphPath self, IEndPoints endpoints) { self.Path .Where(vertex => !endpoints.IsEndPoint(vertex)) .OfType <IMarkable>() .ForEach(vertex => vertex.MarkAsPath()); }
public HttpPooledClient(HttpReactor reactor, IEndPoints endPoints, TimeSpan connectTimeout, TimeSpan sendTimeout, TimeSpan connectionExpire) { _reactor = reactor; _client = new HttpClient(endPoints, connectTimeout, sendTimeout, connectionExpire); }
/// <summary> /// Initializes a new instance of the <see cref="OrdersService" /> class. /// </summary> /// <param name="httpClient">The HTTP client.</param> /// <param name="endPoints">The end points.</param> /// <param name="authorizationToken">The authorization token.</param> /// <param name="rateLimits">The rate limits.</param> public OrdersService( HttpClient httpClient, IEndPoints endPoints, IAuthorizationToken authorizationToken, RateLimits rateLimits = null) : base(httpClient, endPoints, authorizationToken, rateLimits) { }
public GraphPath(ParentVertices parentVertices, IEndPoints endPoints, IGraph graph, IStepRule stepRule) { this.parentVertices = parentVertices; this.graph = graph; this.endPoints = endPoints; this.stepRule = stepRule; }
/// <summary> /// Initializes a new instance of the <see cref="AuthenticatedClientBase"/> class. /// </summary> /// <param name="httpClient">The HTTP client.</param> /// <param name="endPoints">The end points.</param> /// <param name="authorizationToken">The authorization token.</param> /// <param name="rateLimits">The rate limits.</param> protected AuthenticatedClientBase( HttpClient httpClient, IEndPoints endPoints, IAuthorizationToken authorizationToken, RateLimits rateLimits = null) : base(httpClient, endPoints) { _authorizationToken = authorizationToken; RateLimits = rateLimits ?? new RateLimits(); }
public GraphPath(ParentVertices parentVertices, IEndPoints endPoints, IGraph graph, IStepRule stepRule) { path = new Lazy <IVertex[]>(GetPath); pathCost = new Lazy <double>(ExtractPathCost); pathLength = new Lazy <int>(GetPathLength); this.parentVertices = parentVertices; this.graph = graph; this.endPoints = endPoints; this.stepRule = stepRule; }
public AlgorithmEventArgs(int visitedVertices, IEndPoints endPoints = null, IVertex vertex = null) { if (vertex != null) { IsEndPoint = endPoints?.IsEndPoint(vertex) ?? false; } Vertex = vertex ?? new NullVertex(); VisitedVertices = visitedVertices; }
public HttpReactor(IEndPoints endPoints, int maxClients, TimeSpan connectTimeout, TimeSpan sendTimeout, TimeSpan connectionExpire) { _clientQueue = new ConcurrentQueue <HttpPooledClient>(); for (var i = 0; i < maxClients; i++) { var client = new HttpPooledClient(this, endPoints, connectTimeout, sendTimeout, connectionExpire); _clientQueue.Enqueue(client); } }
public HttpClient(IEndPoints endPoints, TimeSpan connectTimeout, TimeSpan sendTimeout, TimeSpan connectionExpire) { var buffer = new ArraySegment <byte>(new byte[DefaultBufferSize]); _message = new HttpMessage(buffer, DefaultMaxHeadersSize); _endPoints = endPoints; _connectTimeoutMicros = connectTimeout.TotalMicroseconds(); _sendTimeoutMicros = sendTimeout.TotalMicroseconds(); _connectionExpireMicros = (connectionExpire == DefaultConnectionExpire) ? Int64.MaxValue : connectionExpire.TotalMicroseconds(); SocketInit(); }
public GraphPathTests() { graphAssemble = new TestGraph2DAssemble(); expectedPraphPathCoordinates = new ICoordinate[] { new TestCoordinate(0, 0), //1 new TestCoordinate(0, 1), //5 new TestCoordinate(1, 2), //8 new TestCoordinate(1, 3), //1 new TestCoordinate(2, 4), //3 new TestCoordinate(3, 5), //2 new TestCoordinate(3, 6), //1 new TestCoordinate(4, 7) //5 }; graph = graphAssemble.AssembleGraph(0); var source = graph[expectedPraphPathCoordinates.First()]; var target = graph[expectedPraphPathCoordinates.Last()]; endPoints = new EndPoints(source, target); parentVertices = new ParentVertices(); FormParentVertices(parentVertices); }
protected BaseGreedyAlgorithm(IGraph graph, IEndPoints endPoints) : base(graph, endPoints) { visitedVerticesStack = new Stack <IVertex>(); }
public GraphPath(ParentVertices parentVertices, IEndPoints endPoints, IGraph graph) : this(parentVertices, endPoints, graph, new DefaultStepRule()) { }
public DepthFirstAlgorithm(IGraph graph, IEndPoints endPoints) : this(graph, endPoints, new ManhattanDistance()) { }
public DepthFirstAlgorithm(IGraph graph, IEndPoints endPoints, IHeuristic heuristic) : base(graph, endPoints) { this.heuristic = heuristic; }
public AStarAlgorithm(IGraph graph, IEndPoints endPoints, IStepRule stepRule, IHeuristic function) : base(graph, endPoints, stepRule) { heuristic = function; }
public EndPoints(IEndPoints endPoints) { End = endPoints.End; Start = endPoints.Start; }
public ViaCepService(IHttpClientFactory clientFactory, IEndPoints settings) { _clientFactory = clientFactory; _settings = settings; }
public AStarAlgorithm(IGraph graph, IEndPoints endPoints, IHeuristic function) : this(graph, endPoints, new DefaultStepRule(), function) { }
public DistanceFirstAlgorithm(IGraph graph, IEndPoints endPoints) : this(graph, endPoints, new EuclidianDistance()) { }
protected abstract IAlgorithm CreateAlgorithm(IGraph graph, IEndPoints endPoints);
public CostGreedyAlgorithm(IGraph graph, IEndPoints endPoints, IStepRule stepRule) : base(graph, endPoints) { this.stepRule = stepRule; }
public AStarAlgorithm(IGraph graph, IEndPoints endPoints, IStepRule stepRule) : this(graph, endPoints, stepRule, new ChebyshevDistance()) { }
public static bool Contains(this IGraph self, IEndPoints endPoints) { return(self.Contains(endPoints.Source, endPoints.Target)); }
protected BaseWaveAlgorithm(IGraph graph, IEndPoints endPoints) : base(graph, endPoints) { verticesQueue = new Queue <IVertex>(); }
protected override IAlgorithm CreateAlgorithm(IGraph graph, IEndPoints endPoints) { return(new AStarAlgorithm.AStarAlgorithm(graph, endPoints)); }
public AStarAlgorithm(IGraph graph, IEndPoints endPoints) : this(graph, endPoints, new DefaultStepRule(), new ChebyshevDistance()) { }