I am sending a request to the "tour plan" calculation that determines routes for multiple bus stops and buses as described here: https://developer.here.com/documentation/tour-planning/2.1.0/dev_guide/topics/concepts/problem.html. Depending on the route type, I either need the bus to drop all riders off at a depot at specific time or pick them up at a depot at a specific time. I see the shift time has a start time and optional end like this "2020-07-04T18:00:00Z".
Why is the date important and not just the time? This route will be used every day.
Why can't I just specify an end time and no start so the stop times are calculated from the destination perspective?
Does the calculation take historical traffic information into account for the time estimates?
Can we please add the TAG attribute to the fleet as well (like the tag in "job") so we can pass arbitrary information through to our consumers of the solution? (Example: my internal id of the destination or start waypoint)
Tourplanning uses date to specify the departure time in routing request so it's needed as part of the API request.
With the current design making the start time optional is not supported currently.
The traffic setting configures what kind of traffic information should be considered for routing:
liveOrHistorical: for departure times in the future, either live or historical traffic data are applied depending on how far in the future the departure time is. For departure times in the past, only historical traffic data are applied. The departure time of a vehicle type can be configured via the vehicle profile's optional departureTime property. In case this property is omitted when defining a vehicle profile, the earliest shift start time of all vehicle types sharing that same vehicle profile is used as that profile's departure time. Choose this setting if all locations are within a radius of 190 km and you want to use live traffic data whenever possible.
historicalOnly: only free-flow speeds based on historical traffic data are applied. Choose this setting if you want to avoid live traffic data usage.
automatic: the same as liveOrHistorical, if all coordinates are within a radius of 190 km, otherwise the same as historicalOnly. Choose this setting if you want the service to decide automatically what is the best option.
Details are provided in this link:
https://developer.here.com/documentation/tour-planning/2.2.0/dev_guide/topics/concepts/configuration.html
No, that is left for pre/post-processing on the client-side.
Related
What is the exact difference between Sheduing Events and Transaction time windows in Corda
Time-Windows: Imagine you have a state that represents a sales offer (e.g. a dealership is selling a car at a certain price); this offer might be limited (e.g. Christmas time offer), how do you represent that in Corda?
It's a distributed system, nodes can be in different countries with different time-zones; which node has the correct data and time? That's why you can't have a point in time in Corda, you can only have time ranges, this range can be close ended (i.e. between this time and this time), or open ended (i.e. after this time, or before this time).
And since the notary is the last entity that signs a transaction; the notary is the time-stamping entity in a Corda network.
Back to our example, when you construct the transaction that creates the car sales offer, you can have an attribute in the offer that specifies the expiration date of the offer, then inside the flow that accepts (by the buyer) this offer; you can add a time-window with an open end (until expiration date minus 1 second).
With the above setup, the notary will only sign if they received the fully signed transaction (remember that the flow will probably collect the signatures of the seller and buyer) before that time limit. So in short, the signature of the notary will testify that this offer was indeed accepted before the expiration date.
You can read in detail about time-windows here, you'll find an explanation, an exercise, and the solution of the exercise.
Schedulable Events: In Corda, you can have your state automatically trigger certain actions at a relative point in time; for instance you can have the sales proposal get cancelled by the seller once it expires; in order to do so, you specify that your state is a SchedulableState and you implement the nextScheduledActivity() method where you specify what action you want to happen and when.
You can read in detail about schedulable events here, you'll find an explanation, an exercise, and the solution of the exercise.
I have stackdriver alerts/incidents on metrics like cloud run revision request latencies.
If there were a few calls a long time ago that had high latency, but there have not been any new requests since then which had a low latency, the incident will be permanently firing. This is because when there are no new requests coming in, there are no data points for the metric.
Is there a way to automatically stop an incident from firing when there are no recent data points for the underlying metrics? Or is there an alternative way to have alerts on high request latencies in cloud run that automatically switches off the alarm again when no new requests are coming that have a high latency?
The solution of https://stackoverflow.com/a/63997540/6473907 does not work as-is, because the google cloud run built-in metric for the request count does not go to zero when there are no more requests coming in. Instead, it just stops providing any data points. The solution for us was to create a custom logs-based metric that counts the log entries written for every request by cloud run, because the logs-based metric does indeed go to zero, then combine it with the AND_WITH_MATCHING_RESOURCE as described in https://stackoverflow.com/a/63997540/6473907
The chart compares the request count as obtained from the google pre-defined metric run.googleapis.com/request_count (in violet) with the metric generated by a custom logs-based metric (in blue). Only the latter goes to zero when no more requests are coming in.
Edit: This solution will not work because the request count stops being sent to Stackdriver instead of dropping to zero. As explained in the other (more correct) answer, the solution is to create a logs-based metric for the requests, and this will properly drop to zero when there are no additional requests.
This behaviour is documented in the alerting docs:
If measurements are missing (for example, if there are no HTTP
requests for a couple of minutes), the policy uses the last recorded
value to evaluate conditions.
There are a few recommendations in there to mitigate this issue, but all the suggestions assume you're actually collecting metrics, not your situation where there are no metrics at all (because you stopped receiving requests).
This is probably by design: even if you are not receiving additional requests, you might still want to check why all the latest requests had this increased latency.
To work around this feature, you could try to use multiple conditions in your alert policy:
One condition related to the latency: if latency > X
One condition related to the existence of requests: if request count > 1
If you combine those with AND_WITH_MATCHING_RESOURCE, it should only trigger if there's high latency and there are requests. The incident should be resolved when one of the 2 conditions are not met. Even if no new metrics are ingested related to the latency (so the alerting policy still thinks the latency is high), the request count will stop matching after the duration period specified.
I am trying to construct a dataset including road links, their geometries, and information about the roads such as number of lanes, functional class, and average daily traffic. I have been unable to determine whether Here has an API to retrieve something approximating average annual daily traffic for each road link. Is it feasible to retrieve this data?
I've found an API to get general road link information which does not include traffic:
https://developer.here.com/documentation/platform-data/dev_guide/topics/quick-start-view-map-data.html
I've found an API to retrieve map tile images built from historic data (given a day of week and time of day) that shows traffic flow, but does not provide the underlying data:
https://developer.here.com/documentation/map-tile/dev_guide/topics/example-traffic.html
My desired result would be something structured as {road_link_id, annual_average_daily_traffic}, so that I can connect the link with other associated information.
The HERE Traffic API is what you are looking for. It offers:
Traffic Incident Data - provides aggregated information about traffic incidents in XML or JSON, including the type and location of each traffic incident, status, start and end time, and other relevant data. This data is useful to dynamically optimize route calculations.
Traffic Flow Data - provides access to real-time traffic flow data in XML or JSON, including information on speed and congestion for the region(s) defined in each request. The API can also deliver additional data such as the geometry of the road segments in relation to the flow.
Traffic Flow Availability - allows client applications to access traffic flow information (excluding incidents) in an area, if available.
Traffic Map Tile Overlays (Traffic Tiles) - delivers pre-rendered map tile overlays with traffic information that you can readily display with your mapping application. You can request map tiles that show traffic data for a specific area.
See documentation: https://developer.here.com/documentation/traffic/dev_guide/topics/what-is.html
I know that the durationIntraffic is depracated now.
I just cant find a way to get the duration without traffic using google api.
already tried the matrix using DrivingOptions and trafficModel but the duration and duration_in_traffic did not match the duration without traffic in Maps.Google.com
Any help on how to get the duration without traffic data using API?
Image
Duration gives average time and duration in Traffic gives time in traffic .sometimes you run googleApi at midnignt you will find duration in Traffic time is lesser than duration time means duration is not without traffic time.
According to this Google Maps API should return an element called duration as well as an element called duration_in_traffic. Duration will be time without traffic while duration_in_traffic is time with traffic conditions.
Just to set the correct expectations, you shouldn't expect the Web Services API and the Google Maps website to work in the exact same way. These are different products managed by different teams at Google. The search stack is also different, so results may differ.
The result you get in duration field is an approximation of the average travel time for the route. This takes into account average traffic conditions of the last several weeks for a time when you execute a request. That means that the duration can change during the day.
Applying the departure time and traffic_model you can add further information to your requests to get the travel time in the current traffic, this will be provided in a duration_in_traffic field.
Resuming, currently there is no way to get duration without traffic. You will get the average travel time via the API.
I have web application which controls the stores locate din different time zones.
In this web application user will set rules that, any particular product is in discount for any given period of time i.e. 1-Aug 2014 to 5-Aug-2014. so how can this rule be executed in web application. this info can be inserted from anytime zone. but store in Europe and Store in US should have to make this product available from exact 1-Aug-2014, Europe will be early compare to US.
SO how we can handle this kind of scenarios.
In general:
Store the time zone for each store, such as America/Los_Angeles or Europe/London.
When checking for discounts, get the current UTC time and use the store's time zone to determine the appropriate local time.
Compare that local time against the expiration date for the discount.
This assumes that the business rule is to rely upon the store location's time zone. This might not necessarily be the case - as many online stores serve customers worldwide without regard to where the physical store or product is located. In that case, you need to determine who's time zone is applicable. Is it a single fixed time zone for the whole company? Or perhaps it's aligned the end-user's time zone, such that those in different time zones would have the offer expire at different times. You'll need to decide what is appropriate for your particular business.
Sorry I can't be more specific, but you didn't provide many details to go on. If you need further assistance, please consider editing your question to include details such as what language and platform you're using, what code you have tried, and what the specific business rules are.