Repository navigation
v0.19.1
This version is a PATCH: it adds an optional method, a type and an export. No output changes.
A session of a router
- The type
Routerhas a new optional methodsession(graph). It gives aRouterSessionwithroute(edges)anddispose(). session.route(edges)gives the result ofrouter.route({ ...graph, edges }): the same routes, the same points and the same notes.- The session of
cornersRouterkeeps the obstacles and the corner graph of the nodes. A route of a few edges among many nodes does not make them again. - The new function
routerSession(router, graph)gives the session of each router. A router without the method gets a session with no kept work. - A copy of a router of
cornersRouterwith a differentroute, for examplewithRepair(router), gets a session with no kept work. Thus it keeps its own results. - The session holds a snapshot of the nodes. A change of a node needs a new session.
- A test compares the session with the plain route on 350 sets of edges for 10 sets of options of
corners, and on 105 sets for 3 other routers. - The script
scripts/session-time.tstimes the plain route and the session for 2 edges among 400, 800 and 2000 nodes. The workflowRecordsstarts it.
The stamps of a long session
- A grid and the search of a corner graph mark their entries with a stamp. Each query takes the next stamp, and a mark is a 32-bit value.
- A session keeps its grids and its corner graphs for each route, so a stamp can come to the largest 32-bit value.
- At that value, a grid and a search set their marks to 0 and start again at the stamp 1. The cost is one test for each query.
- Without this new start, a grid gives an item more than one time after 2^31 queries, and a search does not end after 2^31 searches.
- The search of
SoftGraphhas the same stamps and the same new start. No session keeps aSoftGraph. - A test lowers the limit, so that one session comes to it many times. Each result keeps the value, the bytes and the work of the default limit.