Recalculating high performance routing network

Data which is used in a more general manner can be requested by xData service. Therefore this data is not provided by one of the other functional services, but concentrated in an own independent service.
Attention: this is not the platform for the data itself. If you have questions about missing data or the handling of binary maps please look at Data and Content.
Post Reply
igorb
Posts: 6
Joined: Thu Apr 13, 2023 7:17 pm

Recalculating high performance routing network

Post by igorb »

Hello,

During implementation of xServer, we encountered an issue with recalculation of high-performance routing networks.

High-performance routing networks are created with PTV_SpeedPatterns and PTV_TrafficIncidents feature layers in the morning for several different TimeConsiderations throughout the day. We wish to update them during the day to account for possible traffic incidents.

When trying to recreate the high-performance routing network, it fails with the following error message: "A high-performance routing network with the requested profile parameter already exists and has been created by a user request already. Check the id field of this result limitations."

One possible solution is to delete the high-performance routing network in question before recreating it. However, ideally, we would like to avoid the downtime of not having a valid HPRN.

Another solution is to use different scopes. I would prefer to avoid using this as we would then need to store data about which scope to use when, what HPRNs are in which scope, and when the HPRNs with said scope were created.

Are there any other possible solutions?

Thank you and best regards,
Igor
User avatar
Bernd Welter
Site Admin
Posts: 2860
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Recalculating high performance routing network

Post by Bernd Welter »

Hi Igor,

from my perspective the following approach might cover your requirement... how about this?
  • Imagine to have a variable "currentScope" that is set to an initial value, e.g. "Scope N".
  • Now you know it is time to create new searchgraphs for a "scope N+1"
  • Write a procedure that creates all relevant info for the new scope (without a "does already exist" conflict)
  • at the end of the procedure you increase the variable currentScope to "scope n+1"
  • then you delete all data from the old "scope n"
  • and so on.
So as long as your "preparation for the next scope is in progress" your application still deals reading the "old scope".
It switches just when everything is ready to be used.

OK, maybe a bit "complicated" but at least thgis would cover what you need?
Or did I miss an aspect?

Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
igorb
Posts: 6
Joined: Thu Apr 13, 2023 7:17 pm

Re: Recalculating high performance routing network

Post by igorb »

Hi,

yes that is a possible solution, but still requires data persistance of said variable N, in order to know when we left on.
But if we expand on the principle:
  • we can have 2 scopes N and M
  • when creating new searchGraph, we check which scope has searchGraph in question
  • we create new searchGraph in opposite scope (N or M)
  • delete previus searchGraph
Then when we use searchGraph, we check both scopes and use the one that has the searchGraph.

Thank you for quick response :D

Igor
User avatar
Bernd Welter
Site Admin
Posts: 2860
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Recalculating high performance routing network

Post by Bernd Welter »

HI Igor,

I like the way you are thinking ;-)
Switching instead of counting sound s ok to me.

Does this mean, the task is resolved?

Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Maximilian Vogel
Posts: 20
Joined: Fri Dec 29, 2017 9:00 am

Re: Recalculating high performance routing network

Post by Maximilian Vogel »

PTV_TrafficIncidents layers are dynamic data that gets updated every few minutes. There are different modes to run the content update service:
  • Continuously: New data replaces the existing data as soon as it is available.
  • On demand: A content update is triggered through a request by the user.
When the content updates are installed contiuously, there can be weird side effects when you create a HPR network in the morning but then use it a couple hours later, because the content of the traffic incidents might has changed and does not necessarily fit to the data inside the HPR network.

To deal with that content snapshots were introduced. With them you can persist the state of the PTV_TrafficIncidents layers. Afterwards, you can use this content snapshot to create a HPR network and of course to calculate routes or distance matrices.

Then you could also stay within one scope as each HPR network would use its own content snapshot. I currently do not see a possibility without managing some sort of state in your application as the xServer doesn't offer replacements of HPR networks.

Best regards,
Max
Maximilian Vogel
Developer
PTV Logistics
Post Reply