/**

   Test file for java implementation of wowa operator
   vicenc torra       http://www.iiia.csic.es/~vtorra

   Implementation of the WOWA operator as described in: 
     V. Torra, The Weighted OWA operator, 
     Int. J. of Intel. Systems, 12 (1997) 153-166.

   And using the interpolation method described in: 
     V. Torra, 
     The WOWA operator and the interpolation function W*: 
     Chen and Otto's interpolation method revisited, 
     Fuzzy Sets and Systems, 113:3 (2000) 389-396.

 */

import ww.*; 

import java.io.*;
import java.lang.*;
import java.util.Vector; 

public class testWowa { 

  public static void main(String args []) throws Exception {
    Vector pesos = new Vector(10);     // p weights corresponding to WM
    Vector weights = new Vector(10);   // w weights corresponding to OWA
    Vector dades= new Vector(10);      // values to be fused
    pesos.addElement(new Double (0.1)); pesos.addElement(new Double (0.2)); 
    pesos.addElement(new Double (0.3)); pesos.addElement(new Double (0.4)); 
    pesos.addElement(new Double(0.0)); 
    weights.addElement(new Double (0.1)); weights.addElement(new Double(0.2)); 
    weights.addElement(new Double (0.3)); weights.addElement(new Double(0.4));
    weights.addElement(new Double (0.0)); 
    dades.addElement(new Double (0.4)); dades.addElement(new Double(0.2)); 
    dades.addElement(new Double (0.3)); dades.addElement(new Double(0.1));
    dades.addElement(new Double (0.0)); 
    
    System.out.println ("Resultat de WM:" + wwv2.wm (pesos, dades));
    System.out.println ("Resultat de OWA:" + wwv2.owa(weights,dades));
    System.out.println ("Resultat de WOWA:" + wwv2.wowa(weights,pesos,dades));
        
  }
};
