rlth tbl hold route to home info: indexed by id - pid: shortest route of offc - (pkgs.ak + (pkgs.rq)) - home pkgs.ak: packages accepted by employee to deliver on way to home pkgs.rq: packages with delivery request send to employee pending for reply pending means not accepted, not declined, and not accepted by other employee (): optional
1 | rp_init_rlth_tbl(loadInitTbl = TRUE)
|
rlth tbl in data.table id: int scalar: home id pid: int scalar: package id in request (0L as current route to home w.o. request) lid: int scalar: package id going to visit and deliver within each id - pid route miles: numeric scalar: miles from (startLat, startLng) to (endLat, endLng) minutes: numeric scalar: minutes from (startLat, startLng) to (endLat, endLng) leg: int scalar: leg from ggmap::route(from, to, structure = "legs") startLat: numeric scalar: start latitude in leg startLng: numeric scalar: start longitude in leg endLat: numeric scalar: end latitude in leg endLng: numeric scalar: end longitude in leg
rlth tbl is indexed by home id and package pid rlth tbl on server side (global environment) should store current route to home only, e.g., package pid is 0L, whereas rlth tbl in client side (local environment) should contain both current route to home and potential route one each for all pid which a deliver request received. rlth tbl on server side should update when 1. new home_id joined in home tbl 2. a package deliver request is accepted rlth tbl on client side should generated at runtime when 1. a client call to rp_create_offc_rt_home() also, lid are package's id within each route indexed by id - pid, it is the package we are heading toward, and as before 0L is home.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.