rohams / capstone

Capstone project
0 stars 0 forks source link

Adding a second DC #20

Open rohams opened 10 years ago

rohams commented 10 years ago

To do the grouping for more than one DC (assuming there is no interaction between the DCs) we need to change the structure of our routes a little bit and as a result revise some of the functions to accommodate these changes in structure:

Instead of passing the separate DC variable to functions, we need to add the DC at the beginning of each route. So for example, Routes array would become: [[DC, 2,4], [DC, 6, 5], [DC, 3, 1,7]]. This way we can assign DC1 and DC2 to different routes and call the insertion function. Aside from initialization the following functions needs some modification:

rand_route rand_break distFromDCToStores off_routing_distance totalDistance graph_groups insertion

Edit (Sahli): route_distance pathsCap

rohams commented 10 years ago

I will do the initialization, insertion and user input.

shzq commented 10 years ago

How is rand_route suppose to change from this?

rohams commented 10 years ago

humm... I think rand_route doesn't change. only rand_brks changes. technically we need to add one more to rand_break to account for the DC at the start of each route.

shzq commented 10 years ago

now it means that the DC in routes is of Node object, and the other elements of the array are numbers (indices for stores in stores array) isn't.

shzq commented 10 years ago

I have committed the code according to the new routes structure. For example, routes will looks like [DC1, 2, 4, DC2, 6, 5, DC1, 3, 1, 7] and brks will be = [2, 5]

The functions that were changed were:

distFromDCToStores (deleted - not used. Used distHaversine function directly instead), off_routing_distance, totalDistance, graph_groups, route_distance (small changes), and pathsCap.

rand_route and rand_break will be modified by Roham in the initialization part.

The changes were not tested yet. The tests can be done after the initialization part is complete that will provide the new routes structure.