• Operational Research Web Services
    • LIMOS 2012 : Webservices' Development
    • LOGO LIMOS

    •    Homepage   
    •    Svg2Png   
    •    Job shop   
    •    GPS for pedestrian   
    •    Job shop time lags   
    •    VRP   
    •    Community-based GPS    
    •    Bin packing    
    •    NFC android    
    •    Sudoku PPC    
  • WS for VRP   |   Core developper   |   Server application   |   Client application   |   WS API   |   Instance format   |   Java client in 5 min.   |   Results

    • Web services to solve the Vehicule Routing Probleme
    • Limitations:
      The maximum number of clients at the same time is 10.
      The maximun number of file at a given time of a same IP adress is 3
      The maximum time your files are saved in the server is 10 minutes
      (it means that if you do not get your file back in time, your file may be deleted).
      You can only use 10 requests in 10 minutes
      You can only get 2000 requests in one day

    • Core developper  
    • photo de Valentin
      Valentin Giboulot

      Email :
      Valentin.Giboulot@gmail.com
      Polytech'Clermont-Ferrand student
      Blaise Pascal University
      1 Rue de la Chebarde, 63178 Aubière CEDEX
    •  
     
    • Web service : Netbeans + GlassFish
     

    • Java Web Service link :

    • This web service is temporarily unavailable until July 8th 2016, if you need an earlier access you can contact Maxime Chassaing at this address: maxime.chassaing[@]gmail[dot]com
      http://orws2.isima.fr/EssaiJavaWebService/EssaiJavaWebService?wsdl


    • Java Web Backup Service :


    • This web service is temporarily unavailable until July 8th 2016, if you need earlier an access you can contact Maxime Chassaing at this address: maxime.chassaing[@]gmail[dot]com
      http://orws.isima.fr/EssaiJavaWebService/EssaiJavaWebService?wsdl


    • Web Service :
    • Download Java Web Service

    • Sources :
    • Download here

    • Client : Java application
     


    • Application is available here : Download
      Sources here : Download
      photo_creation

    • Web service : API Reference
     


    • Function 1 : [String uuid] start_grasp (byte[] file,int largeur_grasp,int profondeur_grasp,Holder error)
      description :
          Function to start a grasp and give your uuid back to ask for your result later

      input :
          file : a byte array with your instance.
          largeur_grasp : how many neighbour you want for your grasp.
          profondeur_grasp : how many time you want for the grasp to cycle.
          error : the error code, use the expliciter_erreur function for details.
      output:
          result :
            #uuid# : "the unique ID of your grasp, you will need it later to get your result"
    • Function 2 : [int result] check(String uuid)
      description :
          Function to check the state of the grasp

      input :
          uuid : ID of your grasp.

      output:
          result :
            #1# : "Task done, you can use the resultat function to get your result"
            #0# : "Task in progress : try later"
            #-1# : "You were too long to get your result, it has been erased"
    • Function 3 : [byte[] result] resultat(String uuid)
      description :
          Function to obtain the result of the start_grasp call. Return a bite array containing a file of your result

      input :
          clef : ID of your grasp.

      output:
          result :
            #result# : a bite array containing a file of your result
    • Function 4 : [String message] expliciter_erreur(int erreur)
      description :
          Function to get the description of the error code.

      input :
          code : code returned by a web fonction

      output:
          message : description of the code
            #0# : "pas d'erreur"
            #1# : "Le serveur est surchargé, veuillez rééssayer plus tard"
            #2# : "Trop de demandes de votre part, veuillez patientez"
            #3# : "fichier vide"
    • Function 5 : [String uuid] stop_grasp(String uuid)
      description :
          Function to stop your grasp if you change your mind.

      input :
          uuid : ID of your grasp.

    • Function 7 : [byte [] result] tour_geant(byte[] file)
      description :
          Function to get a random giant tour for your instance.

      input :
          file : a byte array with your instance.
      output:
          result :
            #result# : a bite array containing a file of your result
    • Function 7 : [byte [] result] recherche_locale(byte[] file,byte[] file_tg)
      description :
          Function to do a local research on a previous solution.

      input :
          file : a byte array with your instance.
          file_tg : a byte array with the solution you want to use a local research on.
      output:
          result :
            #result# : a bite array containing a file of your result
    • Function 8 : [byte [] result] split(byte[] file,byte[] file_tg)
      description :
          Function to do a split on a giant tour to get the best solution you can get with this tour.

      input :
          file : a byte array with your instance.
          file_tg : a byte array with the giant tour.
      output:
          result :
            #result# : a bite array containing a file of your result
      • Syntax of the different files
       


      • Instances files :
        The syntax of the instances files is based on the Christofides instances. You can download some there.
        The syntax is as following :

        Lines 1:5 : these comments
        Line 6 : customers (N), vehicle types (T), range, service time, LB, BKS
        Lines 7:T+6 : per type: number, capacity, fixed cost, cost per distance unit
        Line T+7 : depot coordinates X and Y
        Lines T+8:T+N+7: per customer: coordinates X and Y and demand


        You can get the following errors in your result file :

              #1# : "Error while reading the number of customer"
              #2# : "Error while reading the vehicules capacity"
              #3# : "Error while reading the depot X coordinate"
              #4# : "Error while reading the depot Y coordinate"
              #5# : "Error while reading the clients informations"






       
      • How to create a Java client in 5 minutes ?

      • Start Netbeans and create a new Java application
        photo_creation

        Take one minute to achieve a main window which could be similar to the next window :
        photo_creation

        Add to the projet a reference to the web service. Use for example the following address :
        This web service is temporarily unavailable until July 8th 2016, if you need an earlier access you can contact Maxime Chassaing at this address: maxime.chassaing[@]gmail[dot]com
        http://orws2.isima.fr/EssaiJavaWebService/EssaiJavaWebService?wsdl

        The web service reference must be visible now in the project.
        photo_creation

        The code Java implementation is divided into 6 steps :

        Step 1
        Create a reference to the Soap serveur :

        		ressources.EssaiJavaWebService_Service service = new ressources.EssaiJavaWebService_Service();
                ressources.EssaiJavaWebService port = service.getEssaiJavaWebServicePort();
        


        Step 2
        Read an instance file and transform it into a array of byte. Note we assume the file is mon_instance.inst .

                File f = new File ("mon_instance.inst");
                FileInputStream ips = new FileInputStream(f.getName());
                byte[] in = new byte[ips.available()];
                ips.read(in);
                ips.close();
                Holder‹Integer› error = new Holder‹Integer›();
                Holder‹String› stringError = new Holder‹String›();
        



        Step 3
        Transform the file into an instance

         Data data_instance = port.getData(in, error, stringError);
        


        Step 4
        Create an int holder to get the error code and launch a grasp with some parameters (20,20 here).

        
         			Holder‹Integer› error = new Holder‹Integer›();
                    uuid = startGrasp(in, 20, 20, error);
                    jLabel4.setText((uuid));
        
        

        Step 5
        Check if the grasp is done and get it in this case;

        int check = check(uuid);
        	if(check == 1)            
        	{
        	    byte[] fichier_result = resultat(uuid);
        	    File file_instance = new File("mon_resultat.res");
        	    FileOutputStream fileStream2 = new FileOutputStream(file_instance,false);
        	    fileStream2.write(fichier_result);
        	    fileStream2.close();
        	}
        




      • Results
      • The server where the calcul are done is not very powerful because it's inside a virtual machine, it's processing speed is around 900 MFlops. It haves 4 cores so in theory it can do 4 executions of the GRASP without slowing down, but others web services are hosted on the server. For the same reason, the times can vary considerably. The times are given with a value of the parameters of 50 neighbours and 80 iterations for the ELS. You can get much faster with a lower value of these parameters but the results may not be as good.


        photo_creation
        photo_creation

        • Number of visitors : 3612
        |
          Last update : 15 december 2015