PHP Classes

how to add more client ?

Recommend this page to a friend!

      PHP Vehicle Routing Problem  >  All threads  >  how to add more client ?  >  (Un) Subscribe thread alerts  
Subject:how to add more client ?
Summary:some data are good, some are not, but i can't understand why
Messages:3
Author:HENRY
Date:2016-03-25 12:27:59
 

  1. how to add more client ?   Reply   Report abuse  
Picture of HENRY HENRY - 2016-03-25 12:27:59
Hi,

I have problem to define more locations in the "clients" array

Everytime I try to, I have an error message pointing to line 505 (divided by 0)

I added some "fake" latlng and a new zipcode, some are OK, some are not ok, and I can"t understand why

ex :
I added this line :
array( "latlng"=>"48.7829201,9.2118566","zipcode"=>"12339","load"=>"4"),
everything goes fine

I added this line :
array( "latlng"=>"48.7829201,9.2118666","zipcode"=>"12340","load"=>"4"),
It doesn't work anymore
I remove the line before (zip=12339) and it's working again...
What is the problem please ?

  2. Re: how to add more client ?   Reply   Report abuse  
Picture of Chi H. Chi H. - 2016-03-26 10:19:56 - In reply to message 1 from HENRY
Hi,
thanks for trying it. Maybe ythe client are to far away. When you add clients with very large distances to each other (Tokyo-Barcelona) it produces the error. Can you try it with clients closer or just clients limit to a country not haveing water in between? Also can you try and disable php error, please? AFAIK that I know there are some small bugs, but I don't have so much time :(.


  3. Re: how to add more client ?   Reply   Report abuse  
Picture of dave baldwin dave baldwin - 2020-07-31 11:19:43 - In reply to message 2 from Chi H.
Hi, nice code as a development concept accept lack of comments, but the reason why it is sometimes doing a divide by zero error is in the function combinationsByLenth() where in many instances it will return a blank array - it scans through selective indexes of possible routes, but if any of of possible combinational routes contain the same zipcode (extremely likely) it won't add the data to the return array or the number don't added up to the number of clients (which is likely even with no dupliates).. more likely to return no results than anything at all.

I am seeing if I can recode that function,but lack of comments/documentation makes it tricky.

Nice code as a development class, but for real world scenarios, doesn't work as it stands.